From 0ad556d40a482272c6f7f4a2265600ea9e258659 Mon Sep 17 00:00:00 2001 From: "David L. Qiu" Date: Fri, 26 Apr 2024 12:01:09 -0700 Subject: [PATCH 1/2] load persisted vector stores by default, restoring previous behavior --- packages/jupyter-ai/jupyter_ai/chat_handlers/learn.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/jupyter-ai/jupyter_ai/chat_handlers/learn.py b/packages/jupyter-ai/jupyter_ai/chat_handlers/learn.py index 38390a44c..b3bb0de73 100644 --- a/packages/jupyter-ai/jupyter_ai/chat_handlers/learn.py +++ b/packages/jupyter-ai/jupyter_ai/chat_handlers/learn.py @@ -76,7 +76,7 @@ def _load(self): return self.index = FAISS.load_local( - INDEX_SAVE_DIR, embeddings, index_name=self.index_name + INDEX_SAVE_DIR, embeddings, index_name=self.index_name, allow_dangerous_deserialization=True ) self.load_metadata() except Exception as e: From 22a8d8a65115d48ed969b71dc445e14147054cfe Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 26 Apr 2024 19:02:02 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- packages/jupyter-ai/jupyter_ai/chat_handlers/learn.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/jupyter-ai/jupyter_ai/chat_handlers/learn.py b/packages/jupyter-ai/jupyter_ai/chat_handlers/learn.py index b3bb0de73..f9348a21f 100644 --- a/packages/jupyter-ai/jupyter_ai/chat_handlers/learn.py +++ b/packages/jupyter-ai/jupyter_ai/chat_handlers/learn.py @@ -76,7 +76,10 @@ def _load(self): return self.index = FAISS.load_local( - INDEX_SAVE_DIR, embeddings, index_name=self.index_name, allow_dangerous_deserialization=True + INDEX_SAVE_DIR, + embeddings, + index_name=self.index_name, + allow_dangerous_deserialization=True, ) self.load_metadata() except Exception as e: