Minor changes in handling of punctuation characters
This commit is contained in:
@@ -1,15 +1,14 @@
|
|||||||
# rm test.wav; python tts.py; play test.wav
|
# rm test.wav; python tts.py; play test.wav
|
||||||
|
|
||||||
# Sources:
|
# Sources:
|
||||||
# — https://github.com/AI-Guru/arxiv-reader
|
|
||||||
# — https://huggingface.co/facebook/fastspeech2-en-ljspeech
|
# — 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.checkpoint_utils import load_model_ensemble_and_task_from_hf_hub
|
||||||
from fairseq.models.text_to_speech.hub_interface import TTSHubInterface
|
from fairseq.models.text_to_speech.hub_interface import TTSHubInterface
|
||||||
import scipy
|
import scipy
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import IPython.display as ipd
|
import IPython.display as ipd
|
||||||
import re
|
|
||||||
|
|
||||||
|
|
||||||
models, cfg, task = load_model_ensemble_and_task_from_hf_hub(
|
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
|
# Convert to sentences
|
||||||
for line in lines:
|
for line in lines:
|
||||||
line = line.replace("-", " - ")
|
line = line.replace("-", " - ")
|
||||||
|
line = line.replace("/", ", ")
|
||||||
line = line.replace("—", ". ")
|
line = line.replace("—", ". ")
|
||||||
line = line.replace(":", ". ")
|
line = line.replace(":", ". ")
|
||||||
line = line.replace(";", ". ")
|
line = line.replace(";", ". ")
|
||||||
|
|||||||
Reference in New Issue
Block a user