处理序列化至磁盘的逻辑

This commit is contained in:
glide-the 2023-09-20 21:35:23 +08:00
parent 9bcce0a572
commit bd0164ea62
1 changed files with 3 additions and 0 deletions

View File

@ -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")