Tonic commited on
Commit
65a292c
1 Parent(s): 8b6e3fd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -17
app.py CHANGED
@@ -52,30 +52,30 @@ with gr.Blocks() as demo:
52
  gr.Markdown(title)
53
 
54
  with gr.Tabs():
55
- with gr.TabItem("Standard TTS"):
56
  with gr.Row():
57
- text_input = gr.Textbox(label="Enter text")
58
- lang_input = gr.Dropdown(choices=list(LANGUAGES.keys()), label="Language")
59
- speaker_input = gr.Audio(label="Upload or Record Speaker Audio (optional)", sources=["upload", "microphone"], type="filepath")
60
- generate_button = gr.Button("Generate Speech")
61
  output_audio_standard = gr.Audio(label="🌬️💬📝WhisperSpeech")
62
-
63
- generate_button.click(
64
  whisper_speech_demo,
65
- inputs=[text_input, lang_input, speaker_input, None, None],
66
  outputs=output_audio_standard
67
  )
68
-
69
- with gr.TabItem("Mixed Language TTS"):
70
  with gr.Row():
71
- mix_text_input = gr.Textbox(label="Enter mixed language text", placeholder="e.g., Hello, Cześć")
72
- mix_lang_input = gr.CheckboxGroup(choices=list(LANGUAGES.keys()), label="Select Languages")
73
- mix_generate_button = gr.Button("Generate Mixed Speech")
74
- output_audio_mixed = gr.Audio(label="🌬️💬📝WhisperSpeech Mixed")
75
-
76
- mix_generate_button.click(
77
  whisper_speech_demo,
78
- inputs=[mix_text_input, None, None, mix_lang_input, mix_text_input],
79
  outputs=output_audio_mixed
80
  )
81
 
 
52
  gr.Markdown(title)
53
 
54
  with gr.Tabs():
55
+ with gr.TabItem("🌬️💬📝Standard TTS"):
56
  with gr.Row():
57
+ text_input_standard = gr.Textbox(label="Enter text")
58
+ lang_input_standard = gr.Dropdown(choices=list(LANGUAGES.keys()), label="Language")
59
+ speaker_input_standard = gr.Audio(label="Upload or Record Speaker Audio (optional)", sources=["upload", "microphone"], type="filepath")
60
+ generate_button_standard = gr.Button("Generate Speech")
61
  output_audio_standard = gr.Audio(label="🌬️💬📝WhisperSpeech")
62
+
63
+ generate_button_standard.click(
64
  whisper_speech_demo,
65
+ inputs=[text_input_standard, lang_input_standard, speaker_input_standard, None, None],
66
  outputs=output_audio_standard
67
  )
68
+
69
+ with gr.TabItem("🌬️💬📝Mixed Language TTS"):
70
  with gr.Row():
71
+ mix_text_input_mixed = gr.Textbox(label="Enter mixed language text", placeholder="e.g., Hello, Cześć")
72
+ mix_lang_input_mixed = gr.CheckboxGroup(choices=list(LANGUAGES.keys()), label="Select Languages")
73
+ generate_button_mixed = gr.Button("Generate Mixed Speech")
74
+ output_audio_mixed = gr.Audio(label="Mixed🌬️💬📝WhisperSpeech")
75
+
76
+ generate_button_mixed.click(
77
  whisper_speech_demo,
78
+ inputs=[None, None, None, mix_lang_input_mixed, mix_text_input_mixed],
79
  outputs=output_audio_mixed
80
  )
81