From 8ba91e75c62af1718cde95a20c3f428293865bd8 Mon Sep 17 00:00:00 2001 From: Saifeddine ALOUI Date: Tue, 18 Jun 2024 01:24:17 +0200 Subject: [PATCH] upgraded --- lollms/app.py | 3 +++ lollms/server/endpoints/lollms_file_system.py | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lollms/app.py b/lollms/app.py index c37595a..ce3d598 100644 --- a/lollms/app.py +++ b/lollms/app.py @@ -993,6 +993,9 @@ class LollmsApplication(LoLLMsCom): if not self.personality.ignore_discussion_documents_rag: query = None if len(self.active_rag_dbs) > 0 : + if discussion is None: + discussion = self.recover_discussion(client_id) + if self.config.data_vectorization_build_keys_words: self.personality.step_start("Building vector store query") query = self.personality.fast_gen(f"{separator_template}{start_header_id_template}instruction: Read the discussion and rewrite the last prompt for someone who didn't read the entire discussion.\nDo not answer the prompt. Do not add explanations.{separator_template}{start_header_id_template}discussion:\n{discussion[-2048:]}{separator_template}{start_header_id_template}enhanced query: ", max_generation_size=256, show_progress=True, callback=self.personality.sink) diff --git a/lollms/server/endpoints/lollms_file_system.py b/lollms/server/endpoints/lollms_file_system.py index 5ad1327..69435e1 100644 --- a/lollms/server/endpoints/lollms_file_system.py +++ b/lollms/server/endpoints/lollms_file_system.py @@ -236,6 +236,7 @@ def mount_rag_database(database_infos: MountDatabase): from lollmsvectordb import VectorDatabase from lollmsvectordb.text_document_loader import TextDocumentsLoader v = BERTVectorizer() - vdb = VectorDatabase(Path(path)/"db_name.sqlite", v) + vdb = VectorDatabase(Path(path)/"db_name.sqlite", v) + vdb.build_index() lollmsElfServer.active_rag_dbs.append({"name":database_infos.database_name,"path":path,"vectorizer":vdb})