Set whisper thread count based on the model

This commit is contained in:
2023-06-05 14:18:44 -04:00
parent ce1599466e
commit e979d1094c
2 changed files with 9 additions and 2 deletions

View File

@@ -46,7 +46,14 @@ extract-16bit-wav-from-video "$input_video" "$wav_name"
if [[ $? == 1 ]]; then exit 1; fi
for model in "$@"; do
transcribe-audio "$wav_name" "$output_name_without_ext" "${model}"
# Tweak thread count based on model size.
thread_count=4
if [[ $model == "medium" ]]; then
thread_count=8
fi
transcribe-audio "$wav_name" "$output_name_without_ext" "${model}" $thread_count
if [[ $? == 1 ]]; then
printf "${RED}${BOLD}Saving the audio file \"$wav_name\" in case you want to reuse it for debugging.\n${NORMAL}"
exit 1