sonobit commited on
Commit
8ea39df
·
1 Parent(s): fa7931e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -1
app.py CHANGED
@@ -1,3 +1,13 @@
1
  import gradio as gr
 
2
 
3
- gr.Interface.load("models/wannaphong/wav2vec2-large-xlsr-53-th-cv8-deepcut").launch()
 
 
 
 
 
 
 
 
 
 
1
  import gradio as gr
2
+ from transformers import pipeline
3
 
4
+ p = pipeline('speech-to-text', model='wannaphong/wav2vec2-large-xlsr-53-th-cv8-deepcut')
5
+
6
+ def transcribe(audio):
7
+ text = p(audio)["text"]
8
+ return text
9
+
10
+ gr.Interface(
11
+ fn=transcribe,
12
+ inputs=gr.Audio(source="microphone", type="filepath"),
13
+ outputs="text").launch()