Skip to content

Commit d759ff8

Browse files
committed
Allow choice of whisper model even if dir exists
1 parent fc0b724 commit d759ff8

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

setup.sh

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -230,32 +230,32 @@ function getSTT() {
230230
mkdir whisper.cpp
231231
cd whisper.cpp
232232
git clone https://github.com/ggerganov/whisper.cpp.git .
233-
function whichWhisperModel() {
234-
availableModels="tiny, base, small, medium, large"
233+
fi
234+
function whichWhisperModel() {
235+
availableModels="tiny, base, small, medium, large"
236+
echo
237+
echo "Which Whisper model would you like to use?"
238+
echo "Options: $availableModels"
239+
echo '(tiny is recommended)'
240+
echo
241+
read -p "Enter preferred model: " whispermodel
242+
if [[ ! -n ${whispermodel} ]]; then
235243
echo
236-
echo "Which Whisper model would you like to use?"
237-
echo "Options: $availableModels"
238-
echo '(tiny is recommended)'
244+
echo "You must enter a key."
245+
whichWhisperModel
246+
fi
247+
if [[ ! ${whispermodel} == *"$availableModels"* ]]; then
239248
echo
240-
read -p "Enter preferred model: " whispermodel
241-
if [[ ! -n ${whispermodel} ]]; then
242-
echo
243-
echo "You must enter a key."
244-
whichWhisperModel
245-
fi
246-
if [[ ! ${whispermodel} == *"$availableModels"* ]]; then
247-
echo
248-
echo "Invalid model."
249-
whichWhisperModel
250-
fi
251-
}
252-
whichWhisperModel
253-
./models/download-ggml-model.sh $whispermodel
254-
echo "export WHISPER_MODEL=$whispermodel" >> ./chipper/source.sh
255-
cd bindings/go
256-
make whisper
257-
cd ${origDir}
258-
fi
249+
echo "Invalid model."
250+
whichWhisperModel
251+
fi
252+
}
253+
whichWhisperModel
254+
./models/download-ggml-model.sh $whispermodel
255+
echo "export WHISPER_MODEL=$whispermodel" >> ./chipper/source.sh
256+
cd bindings/go
257+
make whisper
258+
cd ${origDir}
259259
else
260260
echo "export STT_SERVICE=coqui" >> ./chipper/source.sh
261261
if [[ ! -f ./stt/completed ]]; then

0 commit comments

Comments
 (0)