From eb2fc67e1c1728e7dea17709918d1415940c4ef9 Mon Sep 17 00:00:00 2001 From: Yiorgis Gozadinos Date: Fri, 26 Sep 2025 19:25:48 +0300 Subject: [PATCH] When populating the eval db, check if chunks for the document have been created. Protects against interrupts --- evaluations/benchmark.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/evaluations/benchmark.py b/evaluations/benchmark.py index 1e42640f..893da371 100644 --- a/evaluations/benchmark.py +++ b/evaluations/benchmark.py @@ -47,8 +47,12 @@ async def populate_db(spec: DatasetSpec) -> None: existing = await rag.get_document_by_uri(payload.uri) if existing is not None: - progress.advance(task) - continue + assert existing.id + chunks = await rag.chunk_repository.get_by_document_id(existing.id) + if chunks: + progress.advance(task) + continue + await rag.document_repository.delete(existing.id) await rag.create_document( content=payload.content,