Spaces:
Sleeping
Sleeping
import gradio as gr | |
from transformers import pipeline | |
trans = pipeline("automatic-speech-recognition", model = "openai/whisper-small") | |
def audio2text(audio): | |
text = trans(audio)["text"] | |
return text | |
gr.Interface( | |
fn=audio2text, | |
inputs = [gr.Audio(source="microphone", type="filepath")], | |
outputs=["textbox"] | |
).launch() |