ArkanDash commited on
Commit
bbc0288
1 Parent(s): d3873a6

feat(app): fix tts mode

Browse files
Files changed (1) hide show
  1. app-full.py +6 -3
app-full.py CHANGED
@@ -134,11 +134,14 @@ def load_hubert():
134
  hubert_model = hubert_model.float()
135
  hubert_model.eval()
136
 
137
- def change_to_tts_mode(tts_mode):
138
  if tts_mode:
139
- return gr.Audio.update(visible=False), gr.Textbox.update(visible=True), gr.Dropdown.update(visible=True)
140
  else:
141
- return gr.Audio.update(visible=True), gr.Textbox.update(visible=False), gr.Dropdown.update(visible=False)
 
 
 
142
 
143
  def change_to_upload_mode(upload_mode):
144
  if upload_mode:
 
134
  hubert_model = hubert_model.float()
135
  hubert_model.eval()
136
 
137
+ def change_to_tts_mode(tts_mode, upload_mode):
138
  if tts_mode:
139
+ return gr.Textbox.update(visible=False), gr.Audio.update(visible=False), gr.Checkbox.update(visible=False), gr.Textbox.update(visible=True), gr.Dropdown.update(visible=True)
140
  else:
141
+ if upload_mode:
142
+ return gr.Textbox.update(visible=False), gr.Audio.update(visible=True), gr.Checkbox.update(visible=True), gr.Textbox.update(visible=False), gr.Dropdown.update(visible=False)
143
+ else:
144
+ return gr.Textbox.update(visible=True), gr.Audio.update(visible=False), gr.Checkbox.update(visible=True), gr.Textbox.update(visible=False), gr.Dropdown.update(visible=False)
145
 
146
  def change_to_upload_mode(upload_mode):
147
  if upload_mode: