目录

Langchain-Chatchat基于WSL安装记录

目录

请先根据官方Readme操作

https://github.com/chatchat-space/Langchain-Chatchat

  1. 安装Windows显卡驱动就绪,CUDA 11.8,环境变量PATH配置好
  2. 安装WSL2 Ubuntu
  3. 安装Miniconda
  4. MiniConda创建venv环境,python=3.11
  5. 手动根据requirements.txt到阿里镜像安装对应cuda的torch、torchaudio、torchvision、xformers版本
  6. 根据官方文档走
  • 报错1

2024-03-07 22:46:16,792 - SentenceTransformer.py[line:66] - INFO: Load pretrained SentenceTransformer: /mnt/d/ai/models/bge-large-zh 2024-03-07 22:46:22,766 - embeddings_api.py[line:39] - ERROR: Error while deserializing header: HeaderTooLarge AttributeError: ‘NoneType’ object has no attribute ‘conjugate’

解决方法:bge-large-zh模型需要把model.safetensors下载下来,包括ChatGLM3-6B也是,默认没有读取pytorch_model-XXX.bin,而是读取.safetensors

  • 报错2

    2024-03-07 23:08:47,000 - utils.py[line:162] - ERROR: ImportError: 为文件/mnt/d/ai/Langchain-Chatchat/knowledge_base/samples/content/llm/img/大模型应用技术原理-幕布图片-580318-260070.jpg查找加载器RapidOCRLoader时出错:libGL.so.1: cannot open shared object file: No such file or directory

解决方法:pip install opencv-python-headless

  • 报错3

    Could not locate the tokenization_chatglm.py inside THUDM/chatglm3-6b.

解决方法:https://github.com/THUDM/ChatGLM3/discussions/894

  • 报错4

(‘samples’, ’test_files/langchain-ChatGLM_open.jsonl’, ‘从文件 samples/test_files/langchain-ChatGLM_open.jsonl 加载文档时出错:jq package not found, please install it with pip install jq’)

解决方法:pip install jq