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