load collectivat
Browse files- app.py +13 -0
- models/bsc/config.json +1 -1
app.py
CHANGED
@@ -26,9 +26,22 @@ def carrega_bsc():
|
|
26 |
|
27 |
return synthesizer
|
28 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
model_bsc = carrega_bsc()
|
30 |
SPEAKERS = model_bsc.speakers
|
31 |
|
|
|
32 |
|
33 |
def tts(text, speaker_idx):
|
34 |
if len(text) > MAX_TXT_LEN:
|
|
|
26 |
|
27 |
return synthesizer
|
28 |
|
29 |
+
def carrega_collectivat():
|
30 |
+
model_path = os.getcwd() + "/models/collectivat/fast-speech_best_model.pth"
|
31 |
+
config_path = os.getcwd() + "/models/collectivat/fast-speech_config.json"
|
32 |
+
vocoder_path = os.getcwd() + "/models/collectivat/ljspeech--hifigan_v2_model_file.pth"
|
33 |
+
vocoder_config_path = os.getcwd() + "/models/collectivat/ljspeech--hifigan_v2_config.json"
|
34 |
+
synthesizer = Synthesizer(
|
35 |
+
model_path, config_path, None, None, vocoder_path, vocoder_config_path
|
36 |
+
)
|
37 |
+
|
38 |
+
return synthesizer
|
39 |
+
|
40 |
+
|
41 |
model_bsc = carrega_bsc()
|
42 |
SPEAKERS = model_bsc.speakers
|
43 |
|
44 |
+
model_collectivat = carrega_collectivat()
|
45 |
|
46 |
def tts(text, speaker_idx):
|
47 |
if len(text) > MAX_TXT_LEN:
|
models/bsc/config.json
CHANGED
@@ -202,7 +202,7 @@
|
|
202 |
"use_spectral_norm_disriminator": false,
|
203 |
"use_speaker_embedding": true,
|
204 |
"num_speakers": 257,
|
205 |
-
"speakers_file": "/home/user/app/speakers.pth",
|
206 |
"d_vector_file": null,
|
207 |
"speaker_embedding_channels": 256,
|
208 |
"use_d_vector_file": false,
|
|
|
202 |
"use_spectral_norm_disriminator": false,
|
203 |
"use_speaker_embedding": true,
|
204 |
"num_speakers": 257,
|
205 |
+
"speakers_file": "/home/user/app/models/bsc/speakers.pth",
|
206 |
"d_vector_file": null,
|
207 |
"speaker_embedding_channels": 256,
|
208 |
"use_d_vector_file": false,
|