Spaces:
Build error
Build error
oops
Browse files- src/utils.py +1 -1
- src/webui.py +5 -0
src/utils.py
CHANGED
|
@@ -222,7 +222,7 @@ def generate(
|
|
| 222 |
|
| 223 |
for line, cut_text in enumerate(texts):
|
| 224 |
if emotion == "Custom":
|
| 225 |
-
if prompt.strip() != "":
|
| 226 |
cut_text = f"[{prompt},] {cut_text}"
|
| 227 |
else:
|
| 228 |
cut_text = f"[I am really {emotion.lower()},] {cut_text}"
|
|
|
|
| 222 |
|
| 223 |
for line, cut_text in enumerate(texts):
|
| 224 |
if emotion == "Custom":
|
| 225 |
+
if prompt and prompt.strip() != "":
|
| 226 |
cut_text = f"[{prompt},] {cut_text}"
|
| 227 |
else:
|
| 228 |
cut_text = f"[I am really {emotion.lower()},] {cut_text}"
|
src/webui.py
CHANGED
|
@@ -45,6 +45,11 @@ def run_generation(
|
|
| 45 |
experimental_checkboxes,
|
| 46 |
progress=gr.Progress(track_tqdm=True)
|
| 47 |
):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
try:
|
| 49 |
sample, outputs, stats = generate(
|
| 50 |
text=text,
|
|
|
|
| 45 |
experimental_checkboxes,
|
| 46 |
progress=gr.Progress(track_tqdm=True)
|
| 47 |
):
|
| 48 |
+
if not text:
|
| 49 |
+
raise gr.Error("Please provide text.")
|
| 50 |
+
if not voice:
|
| 51 |
+
raise gr.Error("Please provide a voice.")
|
| 52 |
+
|
| 53 |
try:
|
| 54 |
sample, outputs, stats = generate(
|
| 55 |
text=text,
|