Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -22,18 +22,24 @@ def speech_to_speech_translation(audio_file):
|
|
| 22 |
# Gradio interfaces
|
| 23 |
iface_s2t = gr.Interface(
|
| 24 |
fn=speech_to_text,
|
| 25 |
-
gr.
|
| 26 |
outputs="text",
|
| 27 |
title="Speech to Text"
|
| 28 |
)
|
| 29 |
|
| 30 |
iface_s2st = gr.Interface(
|
| 31 |
fn=speech_to_speech_translation,
|
| 32 |
-
gr.
|
| 33 |
outputs=["text", "audio"],
|
| 34 |
title="Speech to Speech Translation"
|
| 35 |
)
|
| 36 |
|
| 37 |
-
# Combine into
|
| 38 |
-
|
| 39 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
# Gradio interfaces
|
| 23 |
iface_s2t = gr.Interface(
|
| 24 |
fn=speech_to_text,
|
| 25 |
+
inputs=gr.Audio(type="file", label="Upload Audio for Speech to Text"),
|
| 26 |
outputs="text",
|
| 27 |
title="Speech to Text"
|
| 28 |
)
|
| 29 |
|
| 30 |
iface_s2st = gr.Interface(
|
| 31 |
fn=speech_to_speech_translation,
|
| 32 |
+
inputs=gr.Audio(type="file", label="Upload Audio for Speech to Speech Translation"),
|
| 33 |
outputs=["text", "audio"],
|
| 34 |
title="Speech to Speech Translation"
|
| 35 |
)
|
| 36 |
|
| 37 |
+
# Combine into an accordion interface
|
| 38 |
+
accordion = gr.Accordion(
|
| 39 |
+
iface_s2t,
|
| 40 |
+
iface_s2st,
|
| 41 |
+
labels=["Speech to Text", "Speech to Speech Translation"]
|
| 42 |
+
)
|
| 43 |
+
|
| 44 |
+
# Launch the application
|
| 45 |
+
accordion.launch()
|