Spaces:
Paused
Paused
fix: add validity check for multilingual
Browse files
app.py
CHANGED
@@ -655,6 +655,11 @@ def generate_image_multilingual(bg_prompt, bg_class, bg_tags, seed, cfg, *condit
|
|
655 |
langs = []
|
656 |
bboxes = []
|
657 |
num_boxes = len(stack_cp) if len(stack_cp[-1]) == 4 else len(stack_cp) - 1
|
|
|
|
|
|
|
|
|
|
|
658 |
for i in range(num_boxes):
|
659 |
prompts.append(conditions[i])
|
660 |
colors.append(conditions[i + MAX_TEXT_BOX])
|
|
|
655 |
langs = []
|
656 |
bboxes = []
|
657 |
num_boxes = len(stack_cp) if len(stack_cp[-1]) == 4 else len(stack_cp) - 1
|
658 |
+
|
659 |
+
for i in range(num_boxes):
|
660 |
+
if conditions[i + MAX_TEXT_BOX * 2] is None:
|
661 |
+
raise gr.Error(f"Invalid conditions for box {i + 1} !")
|
662 |
+
|
663 |
for i in range(num_boxes):
|
664 |
prompts.append(conditions[i])
|
665 |
colors.append(conditions[i + MAX_TEXT_BOX])
|