Flux9665 commited on
Commit
3abac7b
·
verified ·
1 Parent(s): 2889ed0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -8
app.py CHANGED
@@ -16,18 +16,12 @@ class TTSWebUI:
16
  tts_model_path=None,
17
  vocoder_model_path=None,
18
  embedding_gan_path=None,
19
- available_artificial_voices=50 # be careful with this, if you want too many, it might lead to an endless loop
20
  ):
21
  path_to_iso_list = hf_hub_download(repo_id="Flux9665/ToucanTTS", filename="iso_to_fullname.json")
22
  iso_to_name = load_json_from_path(path_to_iso_list)
23
  text_selection = [f"{iso_to_name[iso_code]} ({iso_code})" for iso_code in iso_to_name]
24
  # accent_selection = [f"{iso_to_name[iso_code]} Accent ({iso_code})" for iso_code in iso_to_name]
25
- if tts_model_path is None:
26
- tts_model_path = hf_hub_download(repo_id="Flux9665/ToucanTTS", filename="ToucanTTS.pt")
27
- if vocoder_model_path is None:
28
- vocoder_model_path = hf_hub_download(repo_id="Flux9665/ToucanTTS", filename="Vocoder.pt")
29
- if embedding_gan_path is None:
30
- embedding_gan_path = hf_hub_download(repo_id="Flux9665/ToucanTTS", filename="embedding_gan.pt")
31
 
32
  self.controllable_ui = ControllableInterface(gpu_id=gpu_id,
33
  available_artificial_voices=available_artificial_voices,
@@ -45,7 +39,7 @@ class TTSWebUI:
45
  label="Select the Language of the Text (type on your keyboard to find it quickly)"),
46
  gr.Slider(minimum=0.0, maximum=0.8, step=0.1, value=0.5, label="Prosody Creativity"),
47
  gr.Slider(minimum=0.7, maximum=1.3, step=0.1, value=1.0, label="Faster - Slower"),
48
- gr.Slider(minimum=0, maximum=available_artificial_voices, step=1, value=27, label="Random Seed for the artificial Voice"),
49
  gr.Slider(minimum=-10.0, maximum=10.0, step=0.1, value=0.0, label="Gender of artificial Voice"),
50
  gr.Audio(type="filepath", show_label=True, container=True, label="[OPTIONAL] Voice to Clone (if left empty, will use an artificial voice instead)"),
51
  # gr.Slider(minimum=0.5, maximum=1.5, step=0.1, value=1.0, label="Pitch Variance Scale"),
 
16
  tts_model_path=None,
17
  vocoder_model_path=None,
18
  embedding_gan_path=None,
19
+ available_artificial_voices=10 # be careful with this, if you want too many, it might lead to an endless loop
20
  ):
21
  path_to_iso_list = hf_hub_download(repo_id="Flux9665/ToucanTTS", filename="iso_to_fullname.json")
22
  iso_to_name = load_json_from_path(path_to_iso_list)
23
  text_selection = [f"{iso_to_name[iso_code]} ({iso_code})" for iso_code in iso_to_name]
24
  # accent_selection = [f"{iso_to_name[iso_code]} Accent ({iso_code})" for iso_code in iso_to_name]
 
 
 
 
 
 
25
 
26
  self.controllable_ui = ControllableInterface(gpu_id=gpu_id,
27
  available_artificial_voices=available_artificial_voices,
 
39
  label="Select the Language of the Text (type on your keyboard to find it quickly)"),
40
  gr.Slider(minimum=0.0, maximum=0.8, step=0.1, value=0.5, label="Prosody Creativity"),
41
  gr.Slider(minimum=0.7, maximum=1.3, step=0.1, value=1.0, label="Faster - Slower"),
42
+ gr.Slider(minimum=0, maximum=available_artificial_voices, step=1, value=5, label="Random Seed for the artificial Voice"),
43
  gr.Slider(minimum=-10.0, maximum=10.0, step=0.1, value=0.0, label="Gender of artificial Voice"),
44
  gr.Audio(type="filepath", show_label=True, container=True, label="[OPTIONAL] Voice to Clone (if left empty, will use an artificial voice instead)"),
45
  # gr.Slider(minimum=0.5, maximum=1.5, step=0.1, value=1.0, label="Pitch Variance Scale"),