diff --git a/scripts/bench/fetch-parakeet.ps1 b/scripts/bench/fetch-parakeet.ps1 new file mode 100644 index 0000000..a2e860e --- /dev/null +++ b/scripts/bench/fetch-parakeet.ps1 @@ -0,0 +1,25 @@ +# Stages the Parakeet TDT 0.6B v2 int8 bundle (sherpa-onnx export) for the +# asr_bench harness (test_parakeet branch). Bench-only artifact: lives next to +# the app's models but under bench-parakeet\, never read by the app itself. +$ErrorActionPreference = "Stop" +$dest = "$env:LOCALAPPDATA\WhispAssist\models\bench-parakeet" +$url = "https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-nemo-parakeet-tdt-0.6b-v2-int8.tar.bz2" +$cache = "$env:LOCALAPPDATA\WhispAssist\models\bench-cache" +New-Item -ItemType Directory -Force $cache | Out-Null +$archive = Join-Path $cache "parakeet-tdt-0.6b-v2-int8.tar.bz2" + +if (Test-Path (Join-Path $dest "tokens.txt")) { + Write-Output "already staged: $dest" + exit 0 +} +if (-not (Test-Path $archive)) { + Write-Output "downloading $url" + curl.exe -sL -o "$archive.part" $url + if ($LASTEXITCODE -ne 0) { throw "download failed ($LASTEXITCODE)" } + Move-Item -Force "$archive.part" $archive +} +New-Item -ItemType Directory -Force $dest | Out-Null +tar -xjf $archive -C $dest --strip-components=1 +if ($LASTEXITCODE -ne 0) { throw "extract failed ($LASTEXITCODE)" } +Get-ChildItem $dest | Select-Object Name, Length +Write-Output "staged: $dest"