ORI-Muchim commited on
Commit
c911875
1 Parent(s): 8eba93f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -9
app.py CHANGED
@@ -17,15 +17,6 @@ from text.symbols import symbols
17
 
18
  limitation = os.getenv("SYSTEM") == "spaces" # limit text and audio length in huggingface spaces
19
 
20
- if "use_mel_posterior_encoder" in hps.model.keys() and hps.model.use_mel_posterior_encoder == True:
21
- print("Using mel posterior encoder for VITS2")
22
- posterior_channels = 80 # vits2
23
- hps.data.use_mel_posterior_encoder = True
24
- else:
25
- print("Using lin posterior encoder for VITS1")
26
- posterior_channels = hps.data.filter_length // 2 + 1
27
- hps.data.use_mel_posterior_encoder = False
28
-
29
  device = 'cpu'
30
 
31
  def get_text(text, hps):
@@ -101,6 +92,15 @@ if __name__ == '__main__':
101
  cover_path = f"saved_model/cover.png"
102
  hps = utils.get_hparams_from_file(config_path)
103
 
 
 
 
 
 
 
 
 
 
104
  model = SynthesizerTrn(
105
  len(symbols),
106
  posterior_channels,
 
17
 
18
  limitation = os.getenv("SYSTEM") == "spaces" # limit text and audio length in huggingface spaces
19
 
 
 
 
 
 
 
 
 
 
20
  device = 'cpu'
21
 
22
  def get_text(text, hps):
 
92
  cover_path = f"saved_model/cover.png"
93
  hps = utils.get_hparams_from_file(config_path)
94
 
95
+ if "use_mel_posterior_encoder" in hps.model.keys() and hps.model.use_mel_posterior_encoder == True:
96
+ print("Using mel posterior encoder for VITS2")
97
+ posterior_channels = 80 # vits2
98
+ hps.data.use_mel_posterior_encoder = True
99
+ else:
100
+ print("Using lin posterior encoder for VITS1")
101
+ posterior_channels = hps.data.filter_length // 2 + 1
102
+ hps.data.use_mel_posterior_encoder = False
103
+
104
  model = SynthesizerTrn(
105
  len(symbols),
106
  posterior_channels,