From 1004452e958d3b771355b5c097720a10eb62846b Mon Sep 17 00:00:00 2001 From: wangyining02 Date: Wed, 26 Mar 2025 20:29:12 +0800 Subject: [PATCH] =?UTF-8?q?WeTextProcessing:=20overwrite=5Fcache=3DTrue=20?= =?UTF-8?q?=E5=88=B7=E6=96=B0=E5=89=8D=E7=AB=AF=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- indextts/infer.py | 3 +++ indextts/utils/front.py | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/indextts/infer.py b/indextts/infer.py index bc62784..6cb432d 100644 --- a/indextts/infer.py +++ b/indextts/infer.py @@ -58,7 +58,10 @@ class IndexTTS: return self.normalizer.infer(text) def infer(self, audio_prompt, text, output_path): + print(f"origin text:{text}") text = self.preprocess_text(text) + print(f"normalized text:{text}") + audio, sr = torchaudio.load(audio_prompt) audio = torch.mean(audio, dim=0, keepdim=True) diff --git a/indextts/utils/front.py b/indextts/utils/front.py index 5e703e9..4276e08 100644 --- a/indextts/utils/front.py +++ b/indextts/utils/front.py @@ -76,8 +76,8 @@ class TextNormalizer: else: from tn.chinese.normalizer import Normalizer as NormalizerZh from tn.english.normalizer import Normalizer as NormalizerEn - self.zh_normalizer = NormalizerZh(remove_interjections=False, remove_erhua=False) - self.en_normalizer = NormalizerEn() + self.zh_normalizer = NormalizerZh(remove_interjections=False, remove_erhua=False,overwrite_cache=True) + self.en_normalizer = NormalizerEn(overwrite_cache=True) def infer(self, text):