Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -17,6 +17,15 @@ from text.symbols import symbols
|
|
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):
|
|
|
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):
|