Minor changes in handling of punctuation characters

This commit is contained in:
Heiko J Schick
2022-08-30 16:01:45 +02:00
parent 8f185975b6
commit 5978cb7bcf
+2 -2
View File
@@ -1,15 +1,14 @@
# rm test.wav; python tts.py; play test.wav
# Sources:
# — https://github.com/AI-Guru/arxiv-reader
# — https://huggingface.co/facebook/fastspeech2-en-ljspeech
# — https://github.com/AI-Guru/arxiv-reader
from fairseq.checkpoint_utils import load_model_ensemble_and_task_from_hf_hub
from fairseq.models.text_to_speech.hub_interface import TTSHubInterface
import scipy
import numpy as np
import IPython.display as ipd
import re
models, cfg, task = load_model_ensemble_and_task_from_hf_hub(
@@ -31,6 +30,7 @@ with open(f"input.txt", "r") as f:
# Convert to sentences
for line in lines:
line = line.replace("-", " - ")
line = line.replace("/", ", ")
line = line.replace("", ". ")
line = line.replace(":", ". ")
line = line.replace(";", ". ")