Audio-text / app.py
rithanashri's picture
Update app.py
479a553 verified
raw
history blame contribute delete
637 Bytes
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)