Keep empty answers in the final individual outputs.

This commit is contained in:
sebastien committed 2026-10-13 10:15:57 +02:00
1 parent b1f1e0bc86
commit e7094d850e
8 files changed
+164 -37

No files matched your search

@@ -292,8 +292,7 @@ def apply_actions_and_regenerate_grouped(
result["score"] = old_scores[label]
scores[label] = str(result.get("score", 0))
touched[label] = False
if result.get("error") == "empty-answer":
continue
is_empty = result.get("error") == "empty-answer"
saved_image = output_dir / f"{label}.jpg"
baseline_entry = (previous_baseline or {}).get("images", {}).get(label)
if selected_labels and label not in selected_labels and (saved_image.is_file() or baseline_entry):
@@ -319,6 +318,8 @@ def apply_actions_and_regenerate_grouped(
)
dirty_images[label] = final_image
scores[label] = str(old_scores.get(label, scores[label]))
if is_empty:
continue
concat_images.append(final_image)
answer_labels.append(label)
filtered_labels.append(label)
@@ -344,6 +345,7 @@ def apply_actions_and_regenerate_grouped(
result,
content["coordinates"][0],
with_error=False,
with_empty=True,
)
if final_image is None:
incomplete = True
@@ -368,6 +370,8 @@ def apply_actions_and_regenerate_grouped(
# Persist every final block, including unchanged answers, for returns.
dirty_images[label] = final_image
header_heights[label] = new_header_height
if is_empty:
continue
answer_labels.append(label)
concat_images.append(final_image)