video-whisper / app.py
AndrewRWilliams
change gradio input function
8582fe6
raw
history blame
540 Bytes
import gradio as gr
import whisper
model = whisper.load_model("base")
def transcribe(file):
result = model.transcribe(file)
text = result['text']
f = open("transcript_base.txt", "w")
f.write(text)
f.close()
return "transcript_base.txt"
iface = gr.Interface(
title = 'OpenAI Whisper ASR Gradio Web UI',
fn=transcribe,
inputs=[
gr.inputs.Audio(source="upload", type="filepath", label="Upload Audio")
],
outputs=[
gr.File(label="Download"),
],
live=True)
iface.launch()