import gradio as gr from huggingface_hub import InferenceClient import os listen_client = InferenceClient("openai/whisper-medium") def func(audio_): val=listen_client.automatic_speech_recognition(audio_).text return val gr.Interface(fn=func, inputs=gr.Audio(sources=["microphone"], type="filepath"), outputs=gr.Text()).launch()