Tonic commited on
Commit
abd3a21
1 Parent(s): 5123302

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -9
app.py CHANGED
@@ -57,28 +57,33 @@ with gr.Blocks() as demo:
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, "", ""],
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=["", "", "", mix_lang_input_mixed, mix_text_input_mixed],
79
  outputs=output_audio_mixed
80
  )
81
 
82
-
83
 
84
  demo.launch()
 
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
+ placeholder_mix_lang = gr.Textbox(visible=False) # Placeholder, hidden
61
+ placeholder_mix_text = gr.Textbox(visible=False) # Placeholder, hidden
62
  generate_button_standard = gr.Button("Generate Speech")
63
  output_audio_standard = gr.Audio(label="🌬️💬📝WhisperSpeech")
64
 
65
+ generate_button_standard.click(
66
+ whisper_speech_demo,
67
+ inputs=[text_input_standard, lang_input_standard, speaker_input_standard, placeholder_mix_lang, placeholder_mix_text],
68
+ outputs=output_audio_standard
69
+ )
70
+
71
  with gr.TabItem("🌬️💬📝Mixed Language TTS"):
72
  with gr.Row():
73
+ placeholder_text_input = gr.Textbox(visible=False) # Placeholder, hidden
74
+ placeholder_lang_input = gr.Dropdown(choices=[], visible=False) # Placeholder, hidden
75
+ placeholder_speaker_input = gr.Audio(visible=False)
76
  mix_lang_input_mixed = gr.CheckboxGroup(choices=list(LANGUAGES.keys()), label="Select Languages")
77
+ mix_text_input_mixed = gr.Textbox(label="Enter mixed language text", placeholder="e.g., Hello, Cześć")
78
  generate_button_mixed = gr.Button("Generate Mixed Speech")
79
  output_audio_mixed = gr.Audio(label="Mixed🌬️💬📝WhisperSpeech")
80
 
81
  generate_button_mixed.click(
82
  whisper_speech_demo,
83
+ inputs=[placeholder_text_input, placeholder_lang_input, placeholder_speaker_input, mix_lang_input_mixed, mix_text_input_mixed],
84
  outputs=output_audio_mixed
85
  )
86
 
87
+ demo.launch()
88
 
89
  demo.launch()