Flux9665 commited on
Commit
c36ac2d
·
1 Parent(s): 13fc065

try to figure out how ZeroGPU works

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -21,10 +21,10 @@ from Utility.storage_config import MODELS_DIR
21
 
22
  class ControllableInterface(torch.nn.Module):
23
 
24
- def __init__(self, available_artificial_voices=1000):
25
  super().__init__()
26
  self.model = ToucanTTSInterface(device="cpu", tts_model_path="Meta")
27
- self.wgan = GanWrapper(os.path.join(MODELS_DIR, "Embedding", "embedding_gan.pt"), device="cuda" if torch.cuda.is_available() else "cpu")
28
  self.generated_speaker_embeds = list()
29
  self.available_artificial_voices = available_artificial_voices
30
  self.current_language = ""
@@ -124,7 +124,8 @@ available_artificial_voices = 1000
124
  path_to_iso_list = "Preprocessing/multilinguality/iso_to_fullname.json"
125
  iso_to_name = load_json_from_path(path_to_iso_list)
126
  text_selection = [f"{iso_to_name[iso_code]} Text ({iso_code})" for iso_code in iso_to_name]
127
- controllable_ui = ControllableInterface(available_artificial_voices=available_artificial_voices)
 
128
 
129
 
130
  def read(prompt,
 
21
 
22
  class ControllableInterface(torch.nn.Module):
23
 
24
+ def __init__(self, gan_wrapper, available_artificial_voices=1000):
25
  super().__init__()
26
  self.model = ToucanTTSInterface(device="cpu", tts_model_path="Meta")
27
+ self.wgan = gan_wrapper
28
  self.generated_speaker_embeds = list()
29
  self.available_artificial_voices = available_artificial_voices
30
  self.current_language = ""
 
124
  path_to_iso_list = "Preprocessing/multilinguality/iso_to_fullname.json"
125
  iso_to_name = load_json_from_path(path_to_iso_list)
126
  text_selection = [f"{iso_to_name[iso_code]} Text ({iso_code})" for iso_code in iso_to_name]
127
+ gw = GanWrapper(os.path.join(MODELS_DIR, "Embedding", "embedding_gan.pt"), device="cuda" if torch.cuda.is_available() else "cpu")
128
+ controllable_ui = ControllableInterface(gan_wrapper=gw, available_artificial_voices=available_artificial_voices)
129
 
130
 
131
  def read(prompt,