From 69c65c3fe53486c813540f28f5306554fd6911d2 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Sat, 6 Apr 2024 01:55:13 +0200 Subject: Update log messages --- rag/db/document.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rag/db/document.py b/rag/db/document.py index f8c97c2..72e3c66 100644 --- a/rag/db/document.py +++ b/rag/db/document.py @@ -29,12 +29,11 @@ class DocumentDB: self.conn.commit() def __hash(self, chunks: List[Document]) -> str: - log.debug("Generating sha256 hash for pdf document") + log.debug("Generating sha256 hash of the chunks") document = str.encode("".join([chunk.page_content for chunk in chunks])) return hashlib.sha256(document).hexdigest() def add(self, chunks: List[Document]) -> bool: - log.debug("Inserting document hash into documents db...") with self.conn.cursor() as cur: hash = self.__hash(chunks) cur.execute( @@ -47,6 +46,7 @@ class DocumentDB: ) exist = cur.fetchone() if exist is None: + log.debug("Inserting document hash into documents db...") cur.execute( """ INSERT INTO document -- cgit v1.2.3-70-g09d2