ckandemir commited on
Commit
f01321a
1 Parent(s): 0bf57b4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -6
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
  ![Cascaded STST](https://huggingface.co/datasets/huggingface-course/audio-course-images/resolve/main/s2st_cascaded.png "Diagram of cascaded speech to speech translation")
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
- with demo:
98
- gr.TabbedInterface([mic_translate, file_translate], ["Microphone", "Audio File"])
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
  ![Cascaded STST](https://huggingface.co/datasets/huggingface-course/audio-course-images/resolve/main/s2st_cascaded.png "Diagram of cascaded speech to speech translation")
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