speech / app.py
ahmetdogan47's picture
Update app.py
a6f725c verified
raw
history blame contribute delete
347 Bytes
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()