Skip to content

Commit 6f7331c

Browse files
cau-gitCopilot
andauthored
Update docling_eval/utils/external_predictions_visualizer.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Christoph Auer <60343111+cau-git@users.noreply.github.com>
1 parent 71f5e17 commit 6f7331c

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

docling_eval/utils/external_predictions_visualizer.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,14 @@ def _save_visualization(self, record: DatasetRecordWithPrediction) -> None:
150150
record.predicted_page_images,
151151
)
152152

153-
save_comparison_html_with_clusters(
154-
filename=self._visualizations_dir / f"{record.doc_id}.html",
155-
true_doc=gt_doc,
156-
pred_doc=pred_doc,
157-
draw_reading_order=True,
158-
)
153+
try:
154+
save_comparison_html_with_clusters(
155+
filename=self._visualizations_dir / f"{record.doc_id}.html",
156+
true_doc=gt_doc,
157+
pred_doc=pred_doc,
158+
draw_reading_order=True,
159+
)
160+
except (IndexError, ValueError) as e:
161+
_LOGGER.warning(
162+
f"Failed to save visualization for doc_id {record.doc_id}: {e}"
163+
)

0 commit comments

Comments
 (0)