Spaces:
Running
Running
import whisper | |
import gradio as gr | |
model = whisper.load_model("base") | |
def transcribe(audio_filepath): | |
print(f"π Received file: {audio_filepath}") | |
result = model.transcribe(audio_filepath, language="en") | |
return result["text"] | |
print('enter') | |
iface = gr.Interface( | |
fn=transcribe, | |
inputs=gr.Audio(type="filepath", label="audio_filepath"), | |
outputs="text", | |
title="Whisper Transcription (English Only)", | |
description="Upload an English audio file to get transcription using OpenAI's Whisper." | |
) | |
# β Compatible way for Spaces β don't use `enable_queue` if Gradio version < 3.30+ | |
iface.launch(share=True) | |