File size: 336 Bytes
a469909
de5b215
c2b5789
de5b215
a469909
 
 
 
 
 
3f5ff90
06ed778
3f5ff90
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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()