Fix fake model already exists error

This commit is contained in:
mytang0 2024-04-17 10:19:58 +08:00
parent a750868428
commit 36dcb97180

View File

@ -96,7 +96,7 @@ printf "Downloading ggml model %s from '%s' ...\n" "$model" "$src"
cd "$models_path" || exit cd "$models_path" || exit
if [ -f "ggml-$model.bin" ]; then if [ -f "ggml-$model.bin" ] && [ -s "ggml-$model.bin" ]; then
printf "Model %s already exists. Skipping download.\n" "$model" printf "Model %s already exists. Skipping download.\n" "$model"
exit 0 exit 0
fi fi
@ -111,6 +111,7 @@ else
fi fi
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
rm -f ggml-"$model".bin
printf "Failed to download ggml model %s \n" "$model" printf "Failed to download ggml model %s \n" "$model"
printf "Please try again later or download the original Whisper model files and convert them yourself.\n" printf "Please try again later or download the original Whisper model files and convert them yourself.\n"
exit 1 exit 1