From 21bccf69d22cb7110822b5ea48cc02bb8632bc70 Mon Sep 17 00:00:00 2001 From: qingxu fu <505030475@qq.com> Date: Thu, 7 Dec 2023 21:29:41 +0800 Subject: [PATCH] add installation info --- crazy_functions/vector_fns/vector_database.py | 3 +-- crazy_functions/知识库问答.py | 11 ++++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/crazy_functions/vector_fns/vector_database.py b/crazy_functions/vector_fns/vector_database.py index b256e70..def2ccc 100644 --- a/crazy_functions/vector_fns/vector_database.py +++ b/crazy_functions/vector_fns/vector_database.py @@ -199,8 +199,7 @@ class LocalDocQA: self.vector_store.save_local(vs_path) return vs_path, loaded_files else: - self.vector_store = FAISS.load_local(vs_path, text2vec) - return vs_path, loaded_files + raise RuntimeError("文件加载失败,请检查文件格式是否正确") def get_loaded_file(self, vs_path): ds = self.vector_store.docstore diff --git a/crazy_functions/知识库问答.py b/crazy_functions/知识库问答.py index 4898835..b6ddb65 100644 --- a/crazy_functions/知识库问答.py +++ b/crazy_functions/知识库问答.py @@ -2,9 +2,14 @@ from toolbox import CatchException, update_ui, ProxyNetworkActivate, update_ui_l from .crazy_utils import request_gpt_model_in_new_thread_with_ui_alive, get_files_from_everything install_msg =""" -pip3 install torch --index-url https://download.pytorch.org/whl/cpu -pip3 install transformers --upgrade -pip3 install langchain sentence-transformers unstructured[all-docs] faiss-cpu nltk beautifulsoup4 bitsandbytes tabulate icetk --upgrade + +1. python -m pip install torch --index-url https://download.pytorch.org/whl/cpu + +2. python -m pip install transformers protobuf langchain sentence-transformers faiss-cpu nltk beautifulsoup4 bitsandbytes tabulate icetk --upgrade + +3. python -m pip install unstructured[all-docs] --upgrade + +4. python -c 'import nltk; nltk.download("punkt")' """ @CatchException