File size: 453 Bytes
2d896a1 ed6538e 2d896a1 ed6538e | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | import gradio as gr
import whisper
model = whisper.load_model("base") # 'tiny', 'small', 'medium', 'large'
def transcribe_audio(audio):
result = model.transcribe(audio)
return result["text"]
audio_inputs = gr.Audio(type="filepath")
interface = gr.Interface(
fn=transcribe_audio,
inputs=audio_inputs,
outputs=gr.Textbox(),
title="MyScribe",
description="Hit record or upload your audio file here."
)
interface.launch()
|