Spaces:
Sleeping
Sleeping
ljspeech voc
Browse files
app.py
CHANGED
@@ -26,14 +26,18 @@ my_outputs = gr.Audio(type="filepath", label="Output Audio")
|
|
26 |
def tts(text: str, split_sentences: bool = True):
|
27 |
best_model_path = hf_hub_download(repo_id=REPO_ID, filename="fast-speech_best_model.pth")
|
28 |
config_path = hf_hub_download(repo_id=REPO_ID, filename="fast-speech_config.json")
|
|
|
|
|
29 |
|
30 |
-
# init synthesizer
|
31 |
synthesizer = Synthesizer(
|
32 |
best_model_path,
|
33 |
config_path,
|
|
|
|
|
34 |
use_cuda=CUDA
|
35 |
)
|
36 |
|
|
|
37 |
# replace oov characters
|
38 |
text = text.replace("\n", ". ")
|
39 |
text = text.replace("(", ",")
|
|
|
26 |
def tts(text: str, split_sentences: bool = True):
|
27 |
best_model_path = hf_hub_download(repo_id=REPO_ID, filename="fast-speech_best_model.pth")
|
28 |
config_path = hf_hub_download(repo_id=REPO_ID, filename="fast-speech_config.json")
|
29 |
+
vocoder_model = hf_hub_download(repo_id=REPO_ID, filename="ljspeech--hifigan_v2_model_file.pth")
|
30 |
+
vocoder_config = hf_hub_download(repo_id=REPO_ID, filename="ljspeech--hifigan_v2_config.json")
|
31 |
|
|
|
32 |
synthesizer = Synthesizer(
|
33 |
best_model_path,
|
34 |
config_path,
|
35 |
+
vocoder_model,
|
36 |
+
vocoder_config,
|
37 |
use_cuda=CUDA
|
38 |
)
|
39 |
|
40 |
+
|
41 |
# replace oov characters
|
42 |
text = text.replace("\n", ". ")
|
43 |
text = text.replace("(", ",")
|