Spaces:
Running on Zero
Running on Zero
| import spaces | |
| import gradio as gr | |
| from transformers import pipeline | |
| MODEL_NAME = "bangla-speech-processing/BanglaASR" | |
| print("Loading model...") | |
| pipe = pipeline( | |
| task="automatic-speech-recognition", | |
| model=MODEL_NAME, | |
| ) | |
| print("Model loaded.") | |
| def transcribe(audio): | |
| if audio is None: | |
| return "" | |
| result = pipe(audio) | |
| return result["text"] | |
| demo = gr.Interface( | |
| fn=transcribe, | |
| inputs=gr.Audio(type="filepath"), | |
| outputs=gr.Textbox(), | |
| title="Bangla Speech Recognition", | |
| description="Bangla ASR using Hugging Face ZeroGPU", | |
| ) | |
| demo.launch() |