import whisper import config import gradio as gr def get_text(audio_path): print(aud) model = whisper.load_model(name='base', download_root=config.MODEL_DIR) results = model.transcribe(audio_path) return results['text'] label = gr.components.Text() vd = gr.components.Audio(type="filepath") iface = gr.Interface(fn=get_text, inputs=vd, outputs=label) iface.launch()