1
0
This commit is contained in:
mrq 2023-02-23 13:18:51 +00:00
parent 41fca1a101
commit 1cbcf14cff
2 changed files with 6 additions and 1 deletions

View File

@ -222,7 +222,7 @@ def generate(
for line, cut_text in enumerate(texts):
if emotion == "Custom":
if prompt.strip() != "":
if prompt and prompt.strip() != "":
cut_text = f"[{prompt},] {cut_text}"
else:
cut_text = f"[I am really {emotion.lower()},] {cut_text}"

View File

@ -45,6 +45,11 @@ def run_generation(
experimental_checkboxes,
progress=gr.Progress(track_tqdm=True)
):
if not text:
raise gr.Error("Please provide text.")
if not voice:
raise gr.Error("Please provide a voice.")
try:
sample, outputs, stats = generate(
text=text,