When populating the eval db, check if chunks for the document have been created. Protects against interrupts

This commit is contained in:
Yiorgis Gozadinos 2025-09-26 19:25:48 +03:00
parent 55dc4bbdd2
commit eb2fc67e1c
No known key found for this signature in database

View file

@ -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,