Sambhavnoobcoder commited on
Commit
e780472
·
1 Parent(s): 58791c2

last hardcode didnt work , did some shady shit to fix the model not loading as it should

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -23,7 +23,7 @@ def set_model(model_name_str):
23
  global tts
24
  tts = TTS(model_path)
25
  speakers = tts.get_speakers()
26
- value = speakers[-1]
27
  return speakers, value
28
 
29
  def main():
@@ -31,7 +31,7 @@ def main():
31
  repo_files = list_repo_files(repo_id="balacoon/tts")
32
  model_files = [x for x in repo_files if x.endswith("_cpu.addon")]
33
  model_name_dropdown = gr.inputs.Dropdown(label="Model", choices=model_files)
34
- speaker_dropdown = gr.inputs.Dropdown(label="Speaker", choices=[92])
35
 
36
  file_input = gr.inputs.File(label="Select a PDF File", type="file")
37
  text = gr.outputs.Textbox()
@@ -65,6 +65,9 @@ def main():
65
  debug=True
66
  )
67
 
 
 
 
68
  iface.launch()
69
 
70
 
 
23
  global tts
24
  tts = TTS(model_path)
25
  speakers = tts.get_speakers()
26
+ value = speakers[0] if speakers else None
27
  return speakers, value
28
 
29
  def main():
 
31
  repo_files = list_repo_files(repo_id="balacoon/tts")
32
  model_files = [x for x in repo_files if x.endswith("_cpu.addon")]
33
  model_name_dropdown = gr.inputs.Dropdown(label="Model", choices=model_files)
34
+ speaker_dropdown = gr.inputs.Dropdown(label="Speaker", choices=[])
35
 
36
  file_input = gr.inputs.File(label="Select a PDF File", type="file")
37
  text = gr.outputs.Textbox()
 
65
  debug=True
66
  )
67
 
68
+ model_name_dropdown.set_action(set_model)
69
+ model_name_dropdown.set_action(set_model)
70
+
71
  iface.launch()
72
 
73