Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,8 +2,14 @@ import gradio as gr
|
|
| 2 |
|
| 3 |
#Get models
|
| 4 |
#ASR model for input speech
|
| 5 |
-
|
| 6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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",
|