Download app.py from Rons2002/MyScribe: direct link, hf CLI and curl.
- Browser
- Download file 453 Bytes
-
https://huggingface.co/spaces/Rons2002/MyScribe/resolve/main/app.py
- Command line
-
hf download hf://spaces/Rons2002/MyScribe/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Rons2002/MyScribe/resolve/main/app.py
453 Bytes
| import gradio as gr | |
| import whisper | |
| model = whisper.load_model("base") # 'tiny', 'small', 'medium', 'large' | |
| def transcribe_audio(audio): | |
| result = model.transcribe(audio) | |
| return result["text"] | |
| audio_inputs = gr.Audio(type="filepath") | |
| interface = gr.Interface( | |
| fn=transcribe_audio, | |
| inputs=audio_inputs, | |
| outputs=gr.Textbox(), | |
| title="MyScribe", | |
| description="Hit record or upload your audio file here." | |
| ) | |
| interface.launch() | |