Spaces:
Running
Running
File size: 637 Bytes
e6b203c 50d8c8c e6b203c 0e661e2 e6b203c 479a553 e6b203c 50d8c8c e6b203c 0e661e2 e6b203c 50d8c8c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
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)
|