提交 5f652183 作者: imClumsyPanda

fix bugs in webui.py

上级 a62617f3
...@@ -259,8 +259,12 @@ def refresh_vs_list(): ...@@ -259,8 +259,12 @@ def refresh_vs_list():
def delete_file(vs_id, files_to_delete, chatbot): def delete_file(vs_id, files_to_delete, chatbot):
vs_path = os.path.join(KB_ROOT_PATH, vs_id, "vector_store") vs_path = os.path.join(KB_ROOT_PATH, vs_id, "vector_store")
content_path = os.path.join(KB_ROOT_PATH, vs_id, "content") content_path = os.path.join(KB_ROOT_PATH, vs_id, "content")
docs_path = [os.path.join(content_path, file) for file in files_to_delete]
status = local_doc_qa.delete_file_from_vector_store(vs_path=vs_path, status = local_doc_qa.delete_file_from_vector_store(vs_path=vs_path,
filepath=[os.path.join(content_path, file) for file in files_to_delete]) filepath=docs_path)
for doc_path in docs_path:
if os.path.exists(doc_path):
os.remove(doc_path)
rested_files = local_doc_qa.list_file_from_vector_store(vs_path) rested_files = local_doc_qa.list_file_from_vector_store(vs_path)
if "fail" in status: if "fail" in status:
vs_status = "文件删除失败。" vs_status = "文件删除失败。"
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论