voice-to-textTH / app.py
sonobit's picture
Update app.py
8ea39df
raw
history blame
340 Bytes
import gradio as gr
from transformers import pipeline
p = pipeline('speech-to-text', model='wannaphong/wav2vec2-large-xlsr-53-th-cv8-deepcut')
def transcribe(audio):
text = p(audio)["text"]
return text
gr.Interface(
fn=transcribe,
inputs=gr.Audio(source="microphone", type="filepath"),
outputs="text").launch()