fix faiss_cache bug

This commit is contained in:
imClumsyPanda 2024-06-09 22:51:48 +08:00
parent 6019af4f33
commit b110fcd01b

View File

@ -110,7 +110,8 @@ class KBFaissPool(_FaissPool):
if os.path.isfile(os.path.join(vs_path, "index.faiss")):
embeddings = get_Embeddings(embed_model=embed_model)
vector_store = FAISS.load_local(vs_path, embeddings, normalize_L2=True)
vector_store = FAISS.load_local(vs_path, embeddings, normalize_L2=True,
allow_dangerous_deserialization=True)
elif create:
# create an empty vector store
if not os.path.exists(vs_path):