Merge pull request #3096 from coqui-ai/fix-xtts-v1.1

Fix xtts v1.1
This commit is contained in:
Eren Gölge 2023-10-21 17:28:58 +02:00 committed by GitHub
commit 420a90ed63
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -6,7 +6,6 @@ import torch
from tokenizers import Tokenizer
import pypinyin
import cutlet
from num2words import num2words
from TTS.tts.layers.xtts.zh_num2words import TextNorm as zh_num2words
@ -484,10 +483,13 @@ class VoiceBpeTokenizer:
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