forked from camenduru/ai-voice-cloning
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:
parent
ec550d74fd
commit
ae5d4023aa
|
@ -226,10 +226,13 @@ def generate(
|
||||||
'cvvp_amount': cvvp_weight,
|
'cvvp_amount': cvvp_weight,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if delimiter is None:
|
||||||
|
delimiter = ""
|
||||||
|
|
||||||
if delimiter == "\\n":
|
if delimiter == "\\n":
|
||||||
delimiter = "\n"
|
delimiter = "\n"
|
||||||
|
|
||||||
if delimiter != "" and delimiter in text:
|
if delimiter and delimiter != "" and delimiter in text:
|
||||||
texts = text.split(delimiter)
|
texts = text.split(delimiter)
|
||||||
else:
|
else:
|
||||||
texts = split_and_recombine_text(text)
|
texts = split_and_recombine_text(text)
|
||||||
|
@ -353,7 +356,7 @@ def generate(
|
||||||
|
|
||||||
info = {
|
info = {
|
||||||
'text': text,
|
'text': text,
|
||||||
'delimiter': '\\n' if delimiter == "\n" else delimiter,
|
'delimiter': '\\n' if delimiter and delimiter == "\n" else delimiter,
|
||||||
'emotion': emotion,
|
'emotion': emotion,
|
||||||
'prompt': prompt,
|
'prompt': prompt,
|
||||||
'voice': voice,
|
'voice': voice,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user