Gregniuki commited on
Commit
4afa588
·
verified ·
1 Parent(s): 562f279

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -8
app.py CHANGED
@@ -859,10 +859,11 @@ with gr.Blocks() as app_emotional:
859
  )
860
 
861
  with gr.Accordion("Advanced Settings", open=False):
862
- remove_silence_emotional = gr.Checkbox(
863
- label="Remove Silences",
864
- value=True,
865
- )
 
866
 
867
  # Generate button
868
  generate_emotional_btn = gr.Button("Generate Emotional Speech", variant="primary")
@@ -876,10 +877,15 @@ with gr.Blocks() as app_emotional:
876
  gen_text,
877
  *args,
878
  ):
 
879
  num_additional_speech_types = max_speech_types - 1
880
- speech_type_names_list = args[:num_additional_speech_types]
881
- speech_type_audios_list = args[num_additional_speech_types:2 * num_additional_speech_types]
882
- speech_type_ref_texts_list = args[2 * num_additional_speech_types:3 * num_additional_speech_types]
 
 
 
 
883
  model_choice = args[3 * num_additional_speech_types]
884
  remove_silence = args[3 * num_additional_speech_types + 1]
885
 
@@ -936,7 +942,7 @@ with gr.Blocks() as app_emotional:
936
  gen_text_input_emotional,
937
  ] + speech_type_names + speech_type_audios + speech_type_ref_texts + [
938
  model_choice_emotional,
939
- remove_silence_emotional,
940
  ],
941
  outputs=audio_output_emotional,
942
  )
 
859
  )
860
 
861
  with gr.Accordion("Advanced Settings", open=False):
862
+ remove_silence_emotional = gr.Radio(
863
+ choices=["True", "False"], # Use strings
864
+ label="Remove Silences",
865
+ value="True", # Use string default
866
+ )
867
 
868
  # Generate button
869
  generate_emotional_btn = gr.Button("Generate Emotional Speech", variant="primary")
 
877
  gen_text,
878
  *args,
879
  ):
880
+
881
  num_additional_speech_types = max_speech_types - 1
882
+ speech_type_names_list = args[0:num_additional_speech_types]
883
+ speech_type_audios_list = args[num_additional_speech_types : 2 * num_additional_speech_types]
884
+ speech_type_ref_texts_list = args[2 * num_additional_speech_types : 3 * num_additional_speech_types]
885
+ model_choice = args[3 * num_additional_speech_types]
886
+ remove_silence_str = args[3 * num_additional_speech_types + 1] # Get the string value
887
+
888
+ remove_silence = remove_silence_str == "True"
889
  model_choice = args[3 * num_additional_speech_types]
890
  remove_silence = args[3 * num_additional_speech_types + 1]
891
 
 
942
  gen_text_input_emotional,
943
  ] + speech_type_names + speech_type_audios + speech_type_ref_texts + [
944
  model_choice_emotional,
945
+ remove_silence_emotional, # Pass the Radio/Dropdown component
946
  ],
947
  outputs=audio_output_emotional,
948
  )