From 3a4efdbb50add7abd26a0f6e145dec1e0b897e77 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Sat, 6 Apr 2024 01:39:58 +0200 Subject: Fix document bug --- rag/rag.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'rag/rag.py') diff --git a/rag/rag.py b/rag/rag.py index 1988ba7..7242db9 100644 --- a/rag/rag.py +++ b/rag/rag.py @@ -27,6 +27,8 @@ class RAG: log.debug(f"Adding pdf with filepath: {filepath} to vector db") points = self.encoder.encode_document(chunks) self.vector_db.add(points) + else: + log.debug("Document already exists!") def __context(self, query_emb: List[StrictFloat], limit: int) -> str: hits = self.vector_db.search(query_emb, limit) -- cgit v1.2.3-70-g09d2