Update inference_webui.py

This commit is contained in:
RVC-Boss 2024-01-26 22:56:32 +08:00 committed by GitHub
parent 2eabcfa828
commit 5237229d39
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -423,6 +423,7 @@ def cut1(inp):
def cut2(inp):
inp = inp.strip("\n")
inps = split(inp)
# print(inps)
if len(inps) < 2:
return inp
opts = []
@ -437,7 +438,8 @@ def cut2(inp):
tmp_str = ""
if tmp_str != "":
opts.append(tmp_str)
if len(opts[-1]) < 50: ##如果最后一个太短了,和前一个合一起
# print(opts)
if len(opts)>1 and len(opts[-1]) < 50: ##如果最后一个太短了,和前一个合一起
opts[-2] = opts[-2] + opts[-1]
opts = opts[:-1]
return "\n".join(opts)