From 36dcb97180b01e5a1e58874227a953f23bdb582b Mon Sep 17 00:00:00 2001 From: mytang0 Date: Wed, 17 Apr 2024 10:19:58 +0800 Subject: [PATCH] Fix fake model already exists error --- models/download-ggml-model.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/models/download-ggml-model.sh b/models/download-ggml-model.sh index 1f1075b6..1d15462d 100755 --- a/models/download-ggml-model.sh +++ b/models/download-ggml-model.sh @@ -96,7 +96,7 @@ printf "Downloading ggml model %s from '%s' ...\n" "$model" "$src" 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" exit 0 fi @@ -111,6 +111,7 @@ else fi if [ $? -ne 0 ]; then + rm -f ggml-"$model".bin 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" exit 1