Skip to content

Commit 75311da

Browse files
fix: handle unsupported END2END evaluation and fix variable name in OCR (#87)
* fix: handle unsupported END2END evaluation and correct variable naming in OCR evaluation * fix: type error --------- Co-authored-by: samiullahchattha <[email protected]>
1 parent 54d013b commit 75311da

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

docling_eval/cli/main.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,7 @@ def evaluate(
430430

431431
if modality == EvaluationModality.END2END:
432432
_log.error("END2END evaluation not supported. ")
433+
return None
433434

434435
elif modality == EvaluationModality.TIMINGS:
435436
timings_evaluator = TimingsEvaluator()
@@ -463,13 +464,13 @@ def evaluate(
463464

464465
elif modality == EvaluationModality.OCR:
465466
ocr_evaluator = OCREvaluator()
466-
ocr_evaluation = ocr_evaluator(
467+
evaluation = ocr_evaluator( # type: ignore
467468
idir,
468469
split=split,
469470
)
470471

471472
with open(save_fn, "w") as fd:
472-
json.dump(ocr_evaluation.model_dump(), fd, indent=2, sort_keys=True)
473+
json.dump(evaluation.model_dump(), fd, indent=2, sort_keys=True)
473474

474475
elif modality == EvaluationModality.READING_ORDER:
475476
readingorder_evaluator = ReadingOrderEvaluator()

0 commit comments

Comments
 (0)