Add Windows model downloader
Browse files- download-models.bat +45 -0
download-models.bat
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
@echo off
|
| 2 |
+
setlocal
|
| 3 |
+
|
| 4 |
+
set "ROOT=%~dp0"
|
| 5 |
+
if "%ROOT:~-1%"=="\" set "ROOT=%ROOT:~0,-1%"
|
| 6 |
+
set "MODELS=%ROOT%\models"
|
| 7 |
+
set "HF_REPO=ZDisket/MOSS-TTS-PNY-GGUF"
|
| 8 |
+
|
| 9 |
+
if not exist "%MODELS%" mkdir "%MODELS%"
|
| 10 |
+
|
| 11 |
+
powershell -NoProfile -ExecutionPolicy Bypass -Command ^
|
| 12 |
+
"$ErrorActionPreference='Stop';" ^
|
| 13 |
+
"$repo='%HF_REPO%';" ^
|
| 14 |
+
"$out='%MODELS%';" ^
|
| 15 |
+
"$files=@(" ^
|
| 16 |
+
" 'moss-tts-pny-f16.gguf'," ^
|
| 17 |
+
" 'moss-tts-pny-global-q8_0.gguf'," ^
|
| 18 |
+
" 'moss-tts-pny-global-q6_k.gguf'," ^
|
| 19 |
+
" 'moss-audio-decoder4-f16.gguf'," ^
|
| 20 |
+
" 'moss-audio-decoder4-q8_0.gguf'," ^
|
| 21 |
+
" 'moss-tts-qwen2-tokenizer.gguf'," ^
|
| 22 |
+
" 'istftnet2_decoder.onnx'," ^
|
| 23 |
+
" 'istftnet2-vocoder-f16.gguf'" ^
|
| 24 |
+
");" ^
|
| 25 |
+
"$headers=@{};" ^
|
| 26 |
+
"if ($env:HF_TOKEN) { $headers['Authorization']='Bearer '+$env:HF_TOKEN };" ^
|
| 27 |
+
"foreach ($f in $files) {" ^
|
| 28 |
+
" $dst=Join-Path $out $f;" ^
|
| 29 |
+
" if (Test-Path $dst) { Write-Host ('Already exists: '+$f); continue }" ^
|
| 30 |
+
" $url='https://huggingface.co/'+$repo+'/resolve/main/'+$f+'?download=true';" ^
|
| 31 |
+
" Write-Host ('Downloading '+$f);" ^
|
| 32 |
+
" Invoke-WebRequest -Uri $url -OutFile $dst -Headers $headers;" ^
|
| 33 |
+
"}" ^
|
| 34 |
+
"Write-Host 'Done.'"
|
| 35 |
+
|
| 36 |
+
if errorlevel 1 (
|
| 37 |
+
echo.
|
| 38 |
+
echo Model download failed.
|
| 39 |
+
pause
|
| 40 |
+
exit /b 1
|
| 41 |
+
)
|
| 42 |
+
|
| 43 |
+
echo.
|
| 44 |
+
echo Models are ready in "%MODELS%".
|
| 45 |
+
pause
|