mirror of
https://github.com/ggerganov/whisper.cpp.git
synced 2024-12-26 16:48:50 +01:00
Added for Windows implemenated script download-ggml-model.cmd
This commit is contained in:
parent
8dac3c6e10
commit
b26345cc7b
63
models/download-ggml-model.cmd
Normal file
63
models/download-ggml-model.cmd
Normal file
@ -0,0 +1,63 @@
|
||||
@echo off
|
||||
|
||||
pushd %~dp0
|
||||
set models_path=%CD%
|
||||
popd
|
||||
|
||||
set argc=0
|
||||
for %%x in (%*) do set /A argc+=1
|
||||
|
||||
set models=tiny.en tiny base.en base small.en small medium.en medium large
|
||||
|
||||
if %argc% neq 1 (
|
||||
echo.
|
||||
echo Usage: download-ggml-model.cmd model
|
||||
CALL :list_models
|
||||
goto :eof
|
||||
)
|
||||
|
||||
set model=%1
|
||||
|
||||
for %%b in (%models%) do (
|
||||
if "%%b"=="%model%" (
|
||||
CALL :download_model
|
||||
goto :eof
|
||||
)
|
||||
)
|
||||
|
||||
echo Invalid model: %model%
|
||||
CALL :list_models
|
||||
goto :eof
|
||||
|
||||
:download_model
|
||||
echo Downloading ggml model %model%...
|
||||
|
||||
cd %models_path%
|
||||
|
||||
if exist "ggml-%model%.bin" (
|
||||
echo Model %model% already exists. Skipping download.
|
||||
goto :eof
|
||||
)
|
||||
|
||||
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "Invoke-WebRequest -Uri https://ggml.ggerganov.com/ggml-model-whisper-%model%.bin -OutFile ggml-%model%.bin"
|
||||
|
||||
if %ERRORLEVEL% neq 0 (
|
||||
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
|
||||
)
|
||||
|
||||
echo Done! Model %model% saved in %models_path%\models\ggml-%model%.bin
|
||||
echo You can now use it like this:
|
||||
echo main.exe -m %models_path%\models\ggml-%model%.bin -f %models_path%\samples\jfk.wav
|
||||
|
||||
goto :eof
|
||||
|
||||
:list_models
|
||||
echo.
|
||||
echo Available models:
|
||||
(for %%a in (%models%) do (
|
||||
echo %%a
|
||||
))
|
||||
echo.
|
||||
exit /b
|
Loading…
Reference in New Issue
Block a user