1. 下载安装包:
下载的版本为:链接:https://pan.baidu.com/s/1ZCcN9V6ATESlqfVS_jr9Uw?pwd=foru 提取码:foru
最新版本:https://github.com/chatchat-space/Langchain-Chatchat.git
2. 创建并激活虚拟环境
conda create --name LANGCHAIN python==3.10.12
conda activate LANGCHAIN
3. 安装相关的依赖:
先进到项目中
$ pip install -r requirements.txt --use-pep517 -i https://mirrors.aliyun.com/pypi/simple/
$ pip install -r requirements_api.txt -i https://mirrors.aliyun.com/pypi/simple/
$ pip install -r requirements_webui.txt -i https://mirrors.aliyun.com/pypi/simple/
4. 配置大模型和embedding包,选用的是chatglm2-6b和m3e-base
大模型配置:
模型下载:https://huggingface.co/models?sort=trending&search=chatglm
自行创建「models」文件夹,下载模型解压到「models」文件夹中
复制模型相关参数配置模板文件 configs/model_config.py.example 存储至项目路径下 ./configs 路径下,并重命名为 model_config.py。
复制服务相关参数配置模板文件 configs/server_config.py.example 存储至项目路径下 ./configs 路径下,并重命名为 server_config.py。
model_config.py 模型配置文件修改:将“m3e-base”:对应的路径改为下载的m3e-base包的绝对路径
5. 启动
第一次启动先初始化知识库
$ python init_database.py
$ python init_database.py --recreate-vs
之后启动项目
$ python startup.py -a
后续启动项目只需
$ python startup.py -a
参考教程:https://blog.csdn.net/weixin_43094965/article/details/133044128