diff --git a/TTS/tts/utils/text/phonemizers/base.py b/TTS/tts/utils/text/phonemizers/base.py index a14a73bc..249c8bce 100644 --- a/TTS/tts/utils/text/phonemizers/base.py +++ b/TTS/tts/utils/text/phonemizers/base.py @@ -92,8 +92,12 @@ class BasePhonemizer(abc.ABC): def _phonemize_preprocess(self, text) -> Tuple[List[str], List]: """Preprocess the text before phonemization + 1. remove spaces + 2. remove punctuation + Override this if you need a different behaviour """ + text = text.strip() if self._keep_puncs: # a tuple (text, punctuation marks) return self._punctuator.strip_to_restore(text)