Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -68,6 +68,7 @@ def speech_to_speech_translation(audio):
|
|
68 |
return 16000, synthesised_speech
|
69 |
|
70 |
|
|
|
71 |
title = "Cascaded STST"
|
72 |
description = """
|
73 |
Demo for cascaded speech-to-speech translation (STST), mapping from source speech in any language to target speech in French. Demo uses OpenAI's [Whisper Large v2](https://huggingface.co/openai/whisper-large-v2) model for speech translation, and [ckandemir/speecht5_finetuned_voxpopuli_fr](https://huggingface.co/ckandemir/speecht5_finetuned_voxpopuli_fr) checkpoint for text-to-speech, which is based on Microsoft's
|
@@ -75,8 +76,6 @@ Demo for cascaded speech-to-speech translation (STST), mapping from source speec
|
|
75 |

|
76 |
"""
|
77 |
|
78 |
-
demo = gr.Blocks()
|
79 |
-
|
80 |
mic_translate = gr.Interface(
|
81 |
fn=speech_to_speech_translation,
|
82 |
inputs=gr.Audio(source="microphone", type="filepath"),
|
@@ -94,9 +93,8 @@ file_translate = gr.Interface(
|
|
94 |
description=description,
|
95 |
)
|
96 |
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
demo.launch()
|
101 |
|
102 |
|
|
|
68 |
return 16000, synthesised_speech
|
69 |
|
70 |
|
71 |
+
|
72 |
title = "Cascaded STST"
|
73 |
description = """
|
74 |
Demo for cascaded speech-to-speech translation (STST), mapping from source speech in any language to target speech in French. Demo uses OpenAI's [Whisper Large v2](https://huggingface.co/openai/whisper-large-v2) model for speech translation, and [ckandemir/speecht5_finetuned_voxpopuli_fr](https://huggingface.co/ckandemir/speecht5_finetuned_voxpopuli_fr) checkpoint for text-to-speech, which is based on Microsoft's
|
|
|
76 |

|
77 |
"""
|
78 |
|
|
|
|
|
79 |
mic_translate = gr.Interface(
|
80 |
fn=speech_to_speech_translation,
|
81 |
inputs=gr.Audio(source="microphone", type="filepath"),
|
|
|
93 |
description=description,
|
94 |
)
|
95 |
|
96 |
+
# Define and launch the tabbed interface directly
|
97 |
+
tabbed_interface = gr.TabbedInterface([mic_translate, file_translate], ["Microphone", "Audio File"])
|
98 |
+
tabbed_interface.launch()
|
|
|
99 |
|
100 |
|