From 27f503632aadd16f87fee07becd05483ff4d9af1 Mon Sep 17 00:00:00 2001 From: Ming <58206790+Ming-Zhou0201@users.noreply.github.com> Date: Thu, 1 Aug 2024 23:05:43 +0800 Subject: [PATCH] =?UTF-8?q?fix=20api.py=20=E4=B8=AD=E8=8B=B1=E6=B7=B7?= =?UTF-8?q?=E5=90=88=E6=A8=A1=E5=BC=8F=E4=B8=8B=EF=BC=8C=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?1.fly=E8=A2=AB=E8=AF=BB=E4=B8=BAone.fly=E7=9A=84=E6=83=85?= =?UTF-8?q?=E5=86=B5=EF=BC=8C=E8=B0=83=E6=95=B4=E5=90=8E=E4=B8=BA=20?= =?UTF-8?q?=E4=B8=80.fly?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix: 中英混合模式下,修复1.fly被读为one.fly的情况,调整后为 一.fly --- api.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api.py b/api.py index 69cbdb46..908ea4c9 100644 --- a/api.py +++ b/api.py @@ -163,7 +163,7 @@ from io import BytesIO from module.models import SynthesizerTrn from AR.models.t2s_lightning_module import Text2SemanticLightningModule from text import cleaned_text_to_sequence -from text.cleaner import clean_text +from text.cleaner import clean_text, language_module_map from module.mel_processing import spectrogram_torch from tools.my_utils import load_audio import config as global_config @@ -290,6 +290,8 @@ def get_phones_and_bert(text,language): dtype=torch.float16 if is_half == True else torch.float32, ).to(device) elif language in {"zh", "ja","auto"}: + if language in ["zh"]: + text = language_module_map[language].text_normalize(text) textlist=[] langlist=[] LangSegment.setfilters(["zh","ja","en","ko"])