mirror of
https://github.com/RVC-Boss/GPT-SoVITS.git
synced 2025-08-29 08:47:37 +08:00
Fix LangSegmenter
This commit is contained in:
parent
74e79ae6d6
commit
746cb536c6
@ -159,6 +159,10 @@ class TextPreprocessor:
|
|||||||
textlist.append(tmp["text"])
|
textlist.append(tmp["text"])
|
||||||
else:
|
else:
|
||||||
for tmp in LangSegmenter.getTexts(text):
|
for tmp in LangSegmenter.getTexts(text):
|
||||||
|
if langlist:
|
||||||
|
if (tmp["lang"] == "en" and langlist[-1] == "en") or (tmp["lang"] != "en" and langlist[-1] != "en"):
|
||||||
|
textlist[-1] += tmp["text"]
|
||||||
|
continue
|
||||||
if tmp["lang"] == "en":
|
if tmp["lang"] == "en":
|
||||||
langlist.append(tmp["lang"])
|
langlist.append(tmp["lang"])
|
||||||
else:
|
else:
|
||||||
|
@ -623,6 +623,10 @@ def get_phones_and_bert(text, language, version, final=False):
|
|||||||
textlist.append(tmp["text"])
|
textlist.append(tmp["text"])
|
||||||
else:
|
else:
|
||||||
for tmp in LangSegmenter.getTexts(text):
|
for tmp in LangSegmenter.getTexts(text):
|
||||||
|
if langlist:
|
||||||
|
if (tmp["lang"] == "en" and langlist[-1] == "en") or (tmp["lang"] != "en" and langlist[-1] != "en"):
|
||||||
|
textlist[-1] += tmp["text"]
|
||||||
|
continue
|
||||||
if tmp["lang"] == "en":
|
if tmp["lang"] == "en":
|
||||||
langlist.append(tmp["lang"])
|
langlist.append(tmp["lang"])
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user