Spaces:
Runtime error
Runtime error
| import gradio as gr | |
| import whisper | |
| # Load the Whisper model | |
| model = whisper.load_model("base") | |
| def transcribe_audio(audio_file): | |
| # Transcribe audio | |
| result = model.transcribe(audio_file) | |
| return result["text"] | |
| # Define Gradio interface | |
| interface = gr.Interface( | |
| fn=transcribe_audio, | |
| inputs=gr.Audio(source="upload", type="filepath"), | |
| outputs="text", | |
| title="Whisper Transcription API" | |
| ) | |
| # Launch the Gradio app | |
| interface.launch() |