Download app.py from mehdiro/test: direct link, hf CLI and curl.
- Browser
- Download file 479 Bytes
-
https://huggingface.co/spaces/mehdiro/test/resolve/main/app.py
- Command line
-
hf download hf://spaces/mehdiro/test/app.py
-
curl -L -o app.py https://huggingface.co/spaces/mehdiro/test/resolve/main/app.py
479 Bytes
| import gradio as gr | |
| from transformers import pipeline | |
| # بارگذاری مدل | |
| model = pipeline("automatic-speech-recognition", model="openai/whisper-large-v3") | |
| # تابع پردازش ورودی | |
| def transcribe(audio): | |
| return model(audio)["text"] | |
| # ایجاد رابط کاربری با Gradio | |
| demo = gr.Interface( | |
| fn=transcribe, | |
| inputs=gr.Audio(type="filepath"), | |
| outputs="text", | |
| title="Pergas ASR demo!", | |
| description="New ASR demo." | |
| ) | |
| demo.launch() | |