@@ -17,7 +17,7 @@ Arguments:
1717 hf_model HuggingFace model ID (required)
1818 Supported models:
1919 - mistralai/Voxtral-Mini-3B-2507
20- - openai/whisper- small
20+ - openai/whisper series (whisper-{ small, medium, large, large-v2, large-v3, large-v3-turbo})
2121 - google/gemma-3-4b-it
2222
2323 quant_name Quantization type (required)
@@ -91,13 +91,13 @@ case "$HF_MODEL" in
9191 AUDIO_FILE=" poem.wav"
9292 IMAGE_PATH=" "
9393 ;;
94- openai/whisper-small )
95- MODEL_NAME=" whisper "
94+ openai/whisper-* )
95+ MODEL_NAME=" ${HF_MODEL # openai / } "
9696 RUNNER_TARGET=" whisper_runner"
9797 RUNNER_PATH=" whisper"
9898 EXPECTED_OUTPUT=" Mr. Quilter is the apostle of the middle classes"
9999 PREPROCESSOR=" whisper_preprocessor.pte"
100- TOKENIZER_URL=" https://huggingface.co/openai/whisper-small /resolve/main" # @lint-ignore
100+ TOKENIZER_URL=" https://huggingface.co/${HF_MODEL} /resolve/main" # @lint-ignore
101101 TOKENIZER_FILE=" "
102102 AUDIO_URL=" "
103103 AUDIO_FILE=" output.wav"
@@ -117,7 +117,7 @@ case "$HF_MODEL" in
117117 ;;
118118 * )
119119 echo " Error: Unsupported model '$HF_MODEL '"
120- echo " Supported models: mistralai/Voxtral-Mini-3B-2507, openai/whisper- small, google/gemma-3-4b-it"
120+ echo " Supported models: mistralai/Voxtral-Mini-3B-2507, openai/whisper series (whisper-{ small, medium, large, large-v2, large-v3, large-v3-turbo}) , google/gemma-3-4b-it"
121121 exit 1
122122 ;;
123123esac
142142# Download test files
143143if [ " $AUDIO_URL " != " " ]; then
144144 curl -L $AUDIO_URL -o ${MODEL_DIR} /$AUDIO_FILE
145- elif [ " $MODEL_NAME " = " whisper" ]; then
145+ elif [[ " $MODEL_NAME " == * whisper* ] ]; then
146146 conda install -y -c conda-forge " ffmpeg<8"
147147 pip install datasets soundfile torchcodec
148148 python -c " from datasets import load_dataset;import soundfile as sf;sample = load_dataset('distil-whisper/librispeech_long', 'clean', split='validation')[0]['audio'];sf.write('${MODEL_DIR} /$AUDIO_FILE ', sample['array'][:sample['sampling_rate']*30], sample['sampling_rate'])"
@@ -179,8 +179,8 @@ case "$MODEL_NAME" in
179179 voxtral)
180180 RUNNER_ARGS=" $RUNNER_ARGS --tokenizer_path ${MODEL_DIR} /$TOKENIZER_FILE --audio_path ${MODEL_DIR} /$AUDIO_FILE --processor_path ${MODEL_DIR} /$PREPROCESSOR "
181181 ;;
182- whisper)
183- RUNNER_ARGS=" $RUNNER_ARGS --tokenizer_path ${MODEL_DIR} / --audio_path ${MODEL_DIR} /$AUDIO_FILE --processor_path ${MODEL_DIR} /$PREPROCESSOR "
182+ whisper- * )
183+ RUNNER_ARGS=" $RUNNER_ARGS --tokenizer_path ${MODEL_DIR} / --audio_path ${MODEL_DIR} /$AUDIO_FILE --processor_path ${MODEL_DIR} /$PREPROCESSOR --model_name ${MODEL_NAME} "
184184 ;;
185185 gemma3)
186186 RUNNER_ARGS=" $RUNNER_ARGS --tokenizer_path ${MODEL_DIR} / --image_path $IMAGE_PATH "
0 commit comments