From bd0164ea6287d3ee72b8022dfee72a95acf36168 Mon Sep 17 00:00:00 2001 From: glide-the <2533736852@qq.com> Date: Wed, 20 Sep 2023 21:35:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E5=BA=8F=E5=88=97=E5=8C=96?= =?UTF-8?q?=E8=87=B3=E7=A3=81=E7=9B=98=E7=9A=84=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/knowledge_base/kb_doc_api.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/knowledge_base/kb_doc_api.py b/server/knowledge_base/kb_doc_api.py index 0a349f7..2c464f2 100644 --- a/server/knowledge_base/kb_doc_api.py +++ b/server/knowledge_base/kb_doc_api.py @@ -323,6 +323,7 @@ def recreate_vector_store( chunk_size: int = Body(CHUNK_SIZE, description="知识库中单段文本最大长度"), chunk_overlap: int = Body(OVERLAP_SIZE, description="知识库中相邻文本重合长度"), zh_title_enhance: bool = Body(ZH_TITLE_ENHANCE, description="是否开启中文标题加强"), + not_refresh_vs_cache: bool = Body(False, description="暂不保存向量库(用于FAISS)"), ): ''' recreate vector store from the content. @@ -366,5 +367,7 @@ def recreate_vector_store( "msg": msg, }) i += 1 + if not not_refresh_vs_cache: + kb.save_vector_store() return StreamingResponse(output(), media_type="text/event-stream")