This commit is contained in:
Saifeddine ALOUI 2024-06-18 01:24:17 +02:00
parent 8ca1e3c2c0
commit 8ba91e75c6
2 changed files with 5 additions and 1 deletions

View File

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

View File

@ -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})