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

Bump qdrant-client from 1.8.2 to 1.9.0 in /intel_extension_for_transformers/neural_chat/tests #1592

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,6 @@ def __init__(self,
knowledge_base = self.database.build(documents=langchain_documents, embedding=self.embeddings, **kwargs)
self.retriever = RetrieverAdapter(retrieval_type=self.retrieval_type, document_store=knowledge_base, \
**kwargs)
if self.vector_database == "Qdrant" and knowledge_base.is_local():
# one local storage folder cannot be accessed by multiple instances of Qdrant client simultaneously.
knowledge_base.client.close()
elif self.retrieval_type == "child_parent": # Using child-parent store retriever
child_documents = self.splitter.split_documents(langchain_documents)
langchain_documents = document_append_id(langchain_documents)
Expand All @@ -206,12 +203,6 @@ def __init__(self,
sign='child', **kwargs)
self.retriever = RetrieverAdapter(retrieval_type=self.retrieval_type, document_store=knowledge_base, \
child_document_store=child_knowledge_base, **kwargs)
if self.vector_database == "Qdrant" :
# one local storage folder cannot be accessed by multiple instances of Qdrant client simultaneously.
if knowledge_base.is_local():
knowledge_base.client.close()
if child_knowledge_base.is_local():
child_knowledge_base.client.close()
elif self.retrieval_type == "bm25":
self.docs = document_append_id(langchain_documents)
self.retriever = RetrieverAdapter(retrieval_type=self.retrieval_type, docs=self.docs, **kwargs)
Expand Down Expand Up @@ -341,4 +332,23 @@ def pre_llm_inference_actions(self, model_name, query):
prompt = generate_qa_prompt(query, context)
else:
logging.error("The selected generation mode is invalid!")

# 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":
to_close = []
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()

return prompt, links
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ pypinyin
python-docx
python-multipart
pyyaml
qdrant-client==1.8.2
qdrant-client==1.9.0
rank_bm25
resampy==0.3.1
rouge_score
Expand Down
Loading