2022-10-30 20:51:29 +01:00
|
|
|
@echo off
|
|
|
|
|
|
|
|
pushd %~dp0
|
|
|
|
set models_path=%CD%
|
2022-12-08 05:18:30 +01:00
|
|
|
for %%d in (%~dp0..) do set root_path=%%~fd
|
2022-10-30 20:51:29 +01:00
|
|
|
popd
|
|
|
|
|
|
|
|
set argc=0
|
|
|
|
for %%x in (%*) do set /A argc+=1
|
|
|
|
|
2023-11-15 18:42:25 +01:00
|
|
|
set models=tiny.en tiny base.en base small.en small medium.en medium large-v1 large-v2 large-v3
|
2022-10-30 20:51:29 +01:00
|
|
|
|
|
|
|
if %argc% neq 1 (
|
|
|
|
echo.
|
|
|
|
echo Usage: download-ggml-model.cmd model
|
|
|
|
CALL :list_models
|
|
|
|
goto :eof
|
|
|
|
)
|
|
|
|
|
|
|
|
set model=%1
|
|
|
|
|
2022-11-15 18:47:06 +01:00
|
|
|
for %%b in (%models%) do (
|
2022-10-30 20:51:29 +01:00
|
|
|
if "%%b"=="%model%" (
|
|
|
|
CALL :download_model
|
|
|
|
goto :eof
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
echo Invalid model: %model%
|
|
|
|
CALL :list_models
|
|
|
|
goto :eof
|
|
|
|
|
|
|
|
:download_model
|
|
|
|
echo Downloading ggml model %model%...
|
|
|
|
|
2023-06-25 14:27:28 +02:00
|
|
|
cd "%models_path%"
|
2022-10-30 20:51:29 +01:00
|
|
|
|
|
|
|
if exist "ggml-%model%.bin" (
|
|
|
|
echo Model %model% already exists. Skipping download.
|
|
|
|
goto :eof
|
|
|
|
)
|
|
|
|
|
2023-10-30 20:18:12 +01:00
|
|
|
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "Start-BitsTransfer -Source https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-%model%.bin -Destination ggml-%model%.bin"
|
2022-10-30 20:51:29 +01:00
|
|
|
|
2022-11-15 18:47:06 +01:00
|
|
|
if %ERRORLEVEL% neq 0 (
|
2022-10-30 20:51:29 +01:00
|
|
|
echo Failed to download ggml model %model%
|
|
|
|
echo Please try again later or download the original Whisper model files and convert them yourself.
|
|
|
|
goto :eof
|
|
|
|
)
|
|
|
|
|
2022-12-08 05:18:30 +01:00
|
|
|
echo Done! Model %model% saved in %root_path%\models\ggml-%model%.bin
|
2022-10-30 20:51:29 +01:00
|
|
|
echo You can now use it like this:
|
2022-12-08 05:18:30 +01:00
|
|
|
echo main.exe -m %root_path%\models\ggml-%model%.bin -f %root_path%\samples\jfk.wav
|
2022-10-30 20:51:29 +01:00
|
|
|
|
|
|
|
goto :eof
|
|
|
|
|
|
|
|
:list_models
|
|
|
|
echo.
|
|
|
|
echo Available models:
|
2023-11-07 14:30:18 +01:00
|
|
|
(for %%a in (%models%) do (
|
|
|
|
echo %%a
|
2022-10-30 20:51:29 +01:00
|
|
|
))
|
|
|
|
echo.
|
|
|
|
exit /b
|