Skip to content

Commit

Permalink
add installation info
Browse files Browse the repository at this point in the history
  • Loading branch information
binary-sky committed Dec 7, 2023
1 parent 7bac8f4 commit 21bccf6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
3 changes: 1 addition & 2 deletions crazy_functions/vector_fns/vector_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,7 @@ def init_knowledge_vector_store(self,
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
Expand Down
11 changes: 8 additions & 3 deletions crazy_functions/知识库问答.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@
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
Expand Down

0 comments on commit 21bccf6

Please sign in to comment.