juulaii commited on
Commit
e60af68
·
1 Parent(s): 6da6a96

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -2,8 +2,14 @@ import gradio as gr
2
 
3
  #Get models
4
  #ASR model for input speech
5
- speech2text = gr.Interface.load("huggingface/facebook/hubert-large-ls960-ft",
6
- inputs=gr.inputs.Audio(label="Record Audio", type="file", source = "microphone"))
 
 
 
 
 
 
7
 
8
  #translates english to spanish text
9
  translator = gr.Interface.load("huggingface/Helsinki-NLP/opus-mt-en-es",
 
2
 
3
  #Get models
4
  #ASR model for input speech
5
+ from transformers import pipeline
6
+
7
+ pipe = pipeline(task="automatic-speech-recognition",
8
+ model="facebook/hubert-large-ls960-ft")
9
+ speech2text = gr.Interface.from_pipeline(pipe,
10
+ inputs=gr.inputs.Audio(label="Record Audio", type="file", source = "microphone"))
11
+ #speech2text = gr.Interface.load("huggingface/facebook/hubert-large-ls960-ft",
12
+ # inputs=gr.inputs.Audio(label="Record Audio", type="file", source = "microphone"))
13
 
14
  #translates english to spanish text
15
  translator = gr.Interface.load("huggingface/Helsinki-NLP/opus-mt-en-es",