mirror of
https://github.com/RVC-Boss/GPT-SoVITS.git
synced 2025-04-05 19:41:56 +08:00
Adjust-tts-clean-text
This commit is contained in:
parent
41041715a4
commit
c767450bb1
@ -245,7 +245,14 @@ def splite_en_inf(sentence, language):
|
||||
|
||||
|
||||
def clean_text_inf(text, language):
|
||||
phones, word2ph, norm_text = clean_text(text, language.replace("all_",""))
|
||||
formattext = ""
|
||||
language = language.replace("all_","")
|
||||
for tmp in LangSegment.getTexts(text):
|
||||
if tmp["lang"] == language:
|
||||
formattext += tmp["text"] + " "
|
||||
while " " in formattext:
|
||||
formattext = formattext.replace(" ", " ")
|
||||
phones, word2ph, norm_text = clean_text(formattext, language)
|
||||
phones = cleaned_text_to_sequence(phones)
|
||||
return phones, word2ph, norm_text
|
||||
|
||||
@ -305,9 +312,8 @@ def nonen_get_bert_inf(text, language):
|
||||
print(langlist)
|
||||
bert_list = []
|
||||
for i in range(len(textlist)):
|
||||
text = textlist[i]
|
||||
lang = langlist[i]
|
||||
phones, word2ph, norm_text = clean_text_inf(text, lang)
|
||||
phones, word2ph, norm_text = clean_text_inf(textlist[i], lang)
|
||||
bert = get_bert_inf(phones, word2ph, norm_text, lang)
|
||||
bert_list.append(bert)
|
||||
bert = torch.cat(bert_list, dim=1)
|
||||
|
Loading…
x
Reference in New Issue
Block a user