mirror of
https://github.com/RVC-Boss/GPT-SoVITS.git
synced 2025-04-27 03:56:41 +08:00
解决输入目标文本的空行导致报错的问题
This commit is contained in:
parent
d2c2d4eb34
commit
95bb2c921e
@ -175,6 +175,9 @@ def get_tts_wav(ref_wav_path, prompt_text, prompt_language, text, text_language)
|
|||||||
dtype=np.float16 if is_half == True else np.float32,
|
dtype=np.float16 if is_half == True else np.float32,
|
||||||
)
|
)
|
||||||
for text in texts:
|
for text in texts:
|
||||||
|
# 解决输入目标文本的空行导致报错的问题
|
||||||
|
if (len(text.strip()) == 0):
|
||||||
|
continue
|
||||||
phones2, word2ph2, norm_text2 = clean_text(text, text_language)
|
phones2, word2ph2, norm_text2 = clean_text(text, text_language)
|
||||||
phones2 = cleaned_text_to_sequence(phones2)
|
phones2 = cleaned_text_to_sequence(phones2)
|
||||||
if prompt_language == "zh":
|
if prompt_language == "zh":
|
||||||
|
Loading…
x
Reference in New Issue
Block a user