Skip to content

Commit

Permalink
Preserve [ja] token of the text processing
Browse files Browse the repository at this point in the history
  • Loading branch information
WeberJulian authored Oct 21, 2023
1 parent c7a1604 commit dad6a7b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions TTS/tts/layers/xtts/tokenizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,10 +483,13 @@ def preprocess_text(self, txt, lang):
if lang == "zh-cn":
txt = chinese_transliterate(txt)
elif lang == "ja":
assert txt[:4] == "[ja]", "Japanese speech should start with the [ja] token."
txt = txt[4:]
if self.katsu is None:
import cutlet
self.katsu = cutlet.Cutlet()
txt = japanese_cleaners(txt, self.katsu)
txt = "[ja]" + txt
else:
raise NotImplementedError()
return txt
Expand Down

0 comments on commit dad6a7b

Please sign in to comment.