Unable to run whisper small finetune after training
I have fine tuned whisper small for Urdu usingthishuggingface post. The original is for Hindi, so basically I just changed “hi” to “ur” and it worked as there is similar amount of data for Urdu available on Mozilla Common Voice.Now I wanna run the model locally using this code chunk (again from the above guide):from transformers import pipeline
import gradio as gr

pipe = pipeline(model="sanchit-gandhi/whisper-small-hi")  # change to "your-username/the-name-you-picked"

def transcribe(audio):
    text = pipe(audio)["text"]
    return text

iface = gr.Interface(
    fn=transcribe, 
    inputs=gr.Audio(source="microphone", type="filepath"), 
    outputs="text",
    title="Whisper Small Hindi",
    description="Realtime demo for Hindi speech recognition using a fine-tuned Whisper small model.",
)

iface.launch()However I am unable to understand how to specifiy the path to my localcheckpoint-5000folder or another folder where I saved the pre-trained model usingtrainer.save_model. There are many posts online on how to load pre-trained (like this one). I always get error when using these methodsfeature_extractornot present, or tokenizer or something else (these files are not present neither incheckpoint-5000nor inwhisper-small-urwhere I manually save usingtrainer.save_model). Any help will be appreciated.
2024-11-30T17:04:28Z
Somebody asked it previously and got it solved.Tokenizer not created when training whisper-small modelBeginnersThis is what helped me. 
Although this command is found in theGoogle Colablinked in the blog, I believe the author accidentally skipped it in the blog itself. 
Before starting the training, we need to save the processor which is not trainable and hence does not change during training. 
processor.save_pretrained(training_args.output_dir)

This will add the necessary files for the tokenizer and whether you use the model locally or push it to hub, it will have all the necessary files.The following line should follow before trainer.train() to save the configurationprocessor.save_pretrained(training_args.output_dir)One wonders why the original post has not been updated with the missing info?!
2024-11-30T17:28:45Z
If anyone doesn’t raise an issue on the Hugging Face github, the author won’t notice it and it won’t get fixed…GitHubHugging FaceThe AI community building the future. Hugging Face has 265 repositories available. Follow their code on GitHub.