From 7201b4500cf7af46cdd894eb4d0eefe80feb1b52 Mon Sep 17 00:00:00 2001 From: James Betker Date: Mon, 21 Feb 2022 19:14:22 -0700 Subject: [PATCH] default text_to_sequence cleaners --- codes/models/tacotron2/text/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/codes/models/tacotron2/text/__init__.py b/codes/models/tacotron2/text/__init__.py index f8a3228f..c8a03a87 100644 --- a/codes/models/tacotron2/text/__init__.py +++ b/codes/models/tacotron2/text/__init__.py @@ -15,7 +15,7 @@ _id_to_symbol = {i: s for i, s in enumerate(symbols)} _curly_re = re.compile(r'(.*?)\{(.+?)\}(.*)') -def text_to_sequence(text, cleaner_names): +def text_to_sequence(text, cleaner_names=['english_cleaners']): '''Converts a string of text to a sequence of IDs corresponding to the symbols in the text. The text can optionally have ARPAbet sequences enclosed in curly braces embedded @@ -58,6 +58,10 @@ def sequence_to_text(sequence): return result.replace('}{', ' ') +def tacotron_symbols(): + return list(_symbol_to_id.keys()) + + def _clean_text(text, cleaner_names): for name in cleaner_names: cleaner = getattr(cleaners, name)