| @echo off |
| setlocal |
|
|
| set "ROOT=%~dp0" |
| if "%ROOT:~-1%"=="\" set "ROOT=%ROOT:~0,-1%" |
| set "MODELS=%ROOT%\models" |
| set "HF_REPO=ZDisket/MOSS-TTS-PNY-GGUF" |
|
|
| if not exist "%MODELS%" mkdir "%MODELS%" |
|
|
| powershell -NoProfile -ExecutionPolicy Bypass -Command ^ |
| "$ErrorActionPreference='Stop';" ^ |
| "$repo='%HF_REPO%';" ^ |
| "$out='%MODELS%';" ^ |
| "$files=@(" ^ |
| " 'moss-tts-pny-f16.gguf'," ^ |
| " 'moss-tts-pny-global-q8_0.gguf'," ^ |
| " 'moss-tts-pny-global-q6_k.gguf'," ^ |
| " 'moss-audio-decoder4-f16.gguf'," ^ |
| " 'moss-audio-decoder4-q8_0.gguf'," ^ |
| " 'moss-tts-qwen2-tokenizer.gguf'," ^ |
| " 'istftnet2_decoder.onnx'," ^ |
| " 'istftnet2-vocoder-f16.gguf'" ^ |
| ");" ^ |
| "$headers=@{};" ^ |
| "if ($env:HF_TOKEN) { $headers['Authorization']='Bearer '+$env:HF_TOKEN };" ^ |
| "foreach ($f in $files) {" ^ |
| " $dst=Join-Path $out $f;" ^ |
| " if (Test-Path $dst) { Write-Host ('Already exists: '+$f); continue }" ^ |
| " $url='https://huggingface.co/'+$repo+'/resolve/main/'+$f+'?download=true';" ^ |
| " Write-Host ('Downloading '+$f);" ^ |
| " Invoke-WebRequest -Uri $url -OutFile $dst -Headers $headers;" ^ |
| "}" ^ |
| "Write-Host 'Done.'" |
|
|
| if errorlevel 1 ( |
| echo. |
| echo Model download failed. |
| pause |
| exit /b 1 |
| ) |
|
|
| echo. |
| echo Models are ready in "%MODELS%". |
| pause |
|
|