1
0

fix for (I assume) some inconsistency with gradio sometimes-but-not-all-the-time coercing an empty Textbox into an empty string or sometimes None, but I also assume that might be a deserialization issue from JSON (cannot be assed to ask people to screenshot UI or send their ./config/generation.json for analysis, so get this hot monkeyshit patch)

This commit is contained in:
mrq 2023-02-19 06:02:47 +00:00
parent ec550d74fd
commit ae5d4023aa

View File

@ -226,10 +226,13 @@ def generate(
'cvvp_amount': cvvp_weight,
}
if delimiter is None:
delimiter = ""
if delimiter == "\\n":
delimiter = "\n"
if delimiter != "" and delimiter in text:
if delimiter and delimiter != "" and delimiter in text:
texts = text.split(delimiter)
else:
texts = split_and_recombine_text(text)
@ -353,7 +356,7 @@ def generate(
info = {
'text': text,
'delimiter': '\\n' if delimiter == "\n" else delimiter,
'delimiter': '\\n' if delimiter and delimiter == "\n" else delimiter,
'emotion': emotion,
'prompt': prompt,
'voice': voice,