diff --git a/tensorflow_tts/utils/cleaners.py b/tensorflow_tts/utils/cleaners.py index cbd4f872..5532f5f9 100755 --- a/tensorflow_tts/utils/cleaners.py +++ b/tensorflow_tts/utils/cleaners.py @@ -24,7 +24,11 @@ from tensorflow_tts.utils.korean import tokenize as ko_tokenize from tensorflow_tts.utils.number_norm import normalize_numbers from unidecode import unidecode -from german_transliterate.core import GermanTransliterate + +try: + from german_transliterate.core import GermanTransliterate +except: + pass # Regular expression matching whitespace: _whitespace_re = re.compile(r"\s+") @@ -111,5 +115,8 @@ def korean_cleaners(text): def german_cleaners(text): """Pipeline for German text, including number and abbreviation expansion.""" - text = GermanTransliterate(replace={';': ',', ':': ' '}, sep_abbreviation=' -- ').transliterate(text) + try: + text = GermanTransliterate(replace={';': ',', ':': ' '}, sep_abbreviation=' -- ').transliterate(text) + except NameError: + raise ModuleNotFoundError("Install german_transliterate package to use german_cleaners") return text \ No newline at end of file