Revert "change g2p and other fix" (#40)

This commit is contained in:
Stardust·减
2023-09-30 09:13:39 +08:00
committed by GitHub
parent c3df0bab67
commit 2f687e4873
11 changed files with 253 additions and 75 deletions

View File

@@ -11,12 +11,7 @@ def cleaned_text_to_sequence(cleaned_text, tones, language):
Returns:
List of integers corresponding to the symbols in the text
"""
phones = [] # _symbol_to_id[symbol] for symbol in cleaned_text
for symbol in cleaned_text:
try:
phones.append(_symbol_to_id[symbol])
except KeyError:
phones.append(0) # symbol not found in ID map, use 0('_') by default
phones = [_symbol_to_id[symbol] for symbol in cleaned_text]
tone_start = language_tone_start_map[language]
tones = [i + tone_start for i in tones]
lang_id = language_id_map[language]