Skip to content

Commit

Permalink
set allow_dangerous_deserialization
Browse files Browse the repository at this point in the history
  • Loading branch information
oeway committed Mar 12, 2024
1 parent 2915045 commit 6a059f0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion bioimageio_chatbot/knowledge_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def load_docs_store(db_path, collection_name):

# Load from vector store
embeddings = OpenAIEmbeddings()
docs_store = FAISS.load_local(index_name=collection_name, folder_path=db_path, embeddings=embeddings)
docs_store = FAISS.load_local(index_name=collection_name, folder_path=db_path, embeddings=embeddings, allow_dangerous_deserialization=True)
return docs_store


Expand Down
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requires = ["setuptools", "wheel"]

[project]
name = "bioimageio-chatbot"
version = "0.1.75"
version = "0.1.76"
readme = "README.md"
description = "Your Personal Assistant in BioImage Analysis."
dependencies = [
Expand All @@ -20,7 +20,8 @@ dependencies = [
"duckduckgo-search>=5.0",
"rank-bm25",
"langchain-openai",
"langchain-community",
"langchain-core>=0.1.31",
"langchain-community>=0.0.27",
"html2text",
]

Expand Down
4 changes: 3 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ hypha>=0.15.50
tqdm
aiofiles
serpapi
langchain>=0.1.10
langchain>=0.1.11
langchain-community==0.0.27
langchain-core==0.1.31
beautifulsoup4
pandas
duckduckgo-search==5.0
Expand Down
2 changes: 1 addition & 1 deletion tests/test_knowledge_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

def test_knowledge_base():
"""Test the knowledge base"""
vectordb = FAISS.load_local(folder_path="./bioimageio-knowledge-base", index_name="bioimage.io", embeddings=OpenAIEmbeddings())
vectordb = FAISS.load_local(folder_path="./bioimageio-knowledge-base", index_name="bioimage.io", embeddings=OpenAIEmbeddings(), allow_dangerous_deserialization=True)
retriever = vectordb.as_retriever(score_threshold=0.4)
items = retriever.get_relevant_documents("community partner", verbose=True)
assert len(items) > 0

0 comments on commit 6a059f0

Please sign in to comment.