Spaces:
Paused
Paused
Update inference_webui.py
Browse files- inference_webui.py +6 -1
inference_webui.py
CHANGED
|
@@ -424,19 +424,24 @@ def get_tts_wav(ref_wav_path, prompt_text, prompt_language, text, text_language,
|
|
| 424 |
print(i18n("实际输入的目标文本(切句后):"), text)
|
| 425 |
texts = text.split("\n")
|
| 426 |
texts = process_text(texts)
|
|
|
|
| 427 |
texts = merge_short_text_in_array(texts, 5)
|
|
|
|
| 428 |
audio_opt = []
|
| 429 |
if not ref_free:
|
| 430 |
phones1,bert1,norm_text1=get_phones_and_bert(prompt_text, prompt_language, version)
|
| 431 |
-
|
| 432 |
for i_text,text in enumerate(texts):
|
| 433 |
# 解决输入目标文本的空行导致报错的问题
|
| 434 |
if (len(text.strip()) == 0):
|
| 435 |
continue
|
|
|
|
| 436 |
if (text[-1] not in splits): text += "。" if text_language != "en" else "."
|
| 437 |
print(i18n("实际输入的目标文本(每句):"), text)
|
|
|
|
| 438 |
phones2,bert2,norm_text2=get_phones_and_bert(text, text_language, version)
|
| 439 |
print(i18n("前端处理后的文本(每句):"), norm_text2)
|
|
|
|
| 440 |
if not ref_free:
|
| 441 |
bert = torch.cat([bert1, bert2], 1)
|
| 442 |
all_phoneme_ids = torch.LongTensor(phones1+phones2).to(device).unsqueeze(0)
|
|
|
|
| 424 |
print(i18n("实际输入的目标文本(切句后):"), text)
|
| 425 |
texts = text.split("\n")
|
| 426 |
texts = process_text(texts)
|
| 427 |
+
print(2)
|
| 428 |
texts = merge_short_text_in_array(texts, 5)
|
| 429 |
+
print(3)
|
| 430 |
audio_opt = []
|
| 431 |
if not ref_free:
|
| 432 |
phones1,bert1,norm_text1=get_phones_and_bert(prompt_text, prompt_language, version)
|
| 433 |
+
print(4)
|
| 434 |
for i_text,text in enumerate(texts):
|
| 435 |
# 解决输入目标文本的空行导致报错的问题
|
| 436 |
if (len(text.strip()) == 0):
|
| 437 |
continue
|
| 438 |
+
print(5)
|
| 439 |
if (text[-1] not in splits): text += "。" if text_language != "en" else "."
|
| 440 |
print(i18n("实际输入的目标文本(每句):"), text)
|
| 441 |
+
print(6)
|
| 442 |
phones2,bert2,norm_text2=get_phones_and_bert(text, text_language, version)
|
| 443 |
print(i18n("前端处理后的文本(每句):"), norm_text2)
|
| 444 |
+
print(7)
|
| 445 |
if not ref_free:
|
| 446 |
bert = torch.cat([bert1, bert2], 1)
|
| 447 |
all_phoneme_ids = torch.LongTensor(phones1+phones2).to(device).unsqueeze(0)
|