From 5978cb7bcf2969fc5149db8922dc2cce34e320eb Mon Sep 17 00:00:00 2001 From: Heiko J Schick Date: Tue, 30 Aug 2022 16:01:45 +0200 Subject: [PATCH] Minor changes in handling of punctuation characters --- tts.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tts.py b/tts.py index 4d597b4..df75175 100644 --- a/tts.py +++ b/tts.py @@ -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(";", ". ")