Spaces:
Runtime error
Runtime error
eric sali commited on
Commit ·
fa9256e
1
Parent(s): 848614f
Add application file
Browse files
app.py
CHANGED
|
@@ -13,12 +13,13 @@ def translate_text(text):
|
|
| 13 |
output_1 = gr.Textbox(label="Speech to Text")
|
| 14 |
output_2 = gr.Textbox(label="Speech Translation")
|
| 15 |
|
| 16 |
-
|
|
|
|
| 17 |
inputs="microphone",
|
| 18 |
outputs=output_1,
|
| 19 |
title="Speech-to-text",
|
| 20 |
)
|
| 21 |
-
|
| 22 |
translator = gr.Interface(fn=translate_text,
|
| 23 |
inputs=output_1,
|
| 24 |
outputs=output_2,
|
|
|
|
| 13 |
output_1 = gr.Textbox(label="Speech to Text")
|
| 14 |
output_2 = gr.Textbox(label="Speech Translation")
|
| 15 |
|
| 16 |
+
# Creates a Gradio interface that loads the pre-trained Facebook Wav2Vec2 model for speech recognition. The input source is set to the user's microphone, and the output is set to output_1. The interface is given the title "Speech-to-text".
|
| 17 |
+
generator = gr.Interface.load("huggingface/facebook/wav2vec2-base-960h",
|
| 18 |
inputs="microphone",
|
| 19 |
outputs=output_1,
|
| 20 |
title="Speech-to-text",
|
| 21 |
)
|
| 22 |
+
# Creates a Gradio interface that uses the translate_text function defined earlier to translate English speech to French text. The input to the interface is set to output_1, which is the speech-to-text transcription
|
| 23 |
translator = gr.Interface(fn=translate_text,
|
| 24 |
inputs=output_1,
|
| 25 |
outputs=output_2,
|