pull/57/head
mrq 2023-02-23 13:18:51 +07:00
parent 41fca1a101
commit 1cbcf14cff
2 changed files with 6 additions and 1 deletions

@ -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}"

@ -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,