whisper / app.py
antfraia's picture
Update app.py
35c0394
raw
history blame
713 Bytes
import gradio as gr
# Load the model without launching the interface
loaded_model = gr.Interface.load("models/openai/whisper-large-v2", allow_launch=False)
def transcribe_audio(audio_file):
# Use the loaded model to transcribe the audio
return loaded_model(audio_file)
audio_input = gr.inputs.Audio(type="filepath")
text_output = gr.outputs.Textbox()
# Setup the custom Gradio interface with your configurations
iface = gr.Interface(
fn=transcribe_audio,
inputs=audio_input,
outputs=text_output,
title="Speech-to-Text using Whisper v2",
description="Upload an audio file to transcribe it to text.",
theme="Monochrome",
live=True,
capture_session=True,
)
iface.launch()