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 = 'Whisper transcription from file', fn=transcribe, inputs=[ gr.inputs.Audio(source="upload", type="filepath", label="Upload Audio") ], outputs=[ gr.File(label="Download"), ], live=True) iface.launch()