Views
No views yet
1
2import gradio as gr
3from transformers import pipeline
4
5# Initialize the pipeline with the specified model
6pipe = pipeline(model="Lingalingeswaran/whisper-tiny-ta")
7
8def transcribe(audio):
9 # Transcribe the audio file to text
10 text = pipe(audio)["text"]
11 return text
12
13# Create the Gradio interface
14
15iface = gr.Interface(
16 fn=transcribe,
17 inputs=gr.Audio(sources=["microphone", "upload"], type="filepath"),
18 outputs="text",
19 title="Whisper tiny tamil",
20 description="Realtime demo for Tamil speech recognition using a fine-tuned Whisper tiny model.",
21)
22
23# Launch the interface
24if __name__ == "__main__":
25 iface.launch()