Skip to content
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
Signed-off-by: yuwenzho <[email protected]>
  • Loading branch information
yuwenzho committed Jun 13, 2024
1 parent 6c5e4bf commit 0cad8a9
Showing 1 changed file with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -329,12 +329,18 @@ def pre_llm_inference_actions(self, model_name, query):
# qdrant local vector db need to be closed
# one local storage folder cannot be accessed by multiple instances of Qdrant client simultaneously.
if self.vector_database == "Qdrant":
knowledge_base = self.retriever.retriever.vectorstore
to_close = []
if self.retrieval_type in ['default', 'child_parent'] and knowledge_base.is_local():
to_close.append(knowledge_base)
if self.retrieval_type == "child_parent" and child_knowledge_base.is_local():
to_close.append(child_knowledge_base)
if self.retrieval_type == "default":
knowledge_base = self.retriever.retriever.vectorstore
if knowledge_base.is_local():
to_close.append(knowledge_base)
if self.retrieval_type == "child_parent":
knowledge_base = self.retriever.retriever.parentstore
child_knowledge_base = self.retriever.retriever.vectorstore
if knowledge_base.is_local():
to_close.append(knowledge_base)
if child_knowledge_base.is_local():
to_close.append(child_knowledge_base)
for kb in to_close:
kb.client.close()

Expand Down

0 comments on commit 0cad8a9

Please sign in to comment.