部署Langchain-Chatchat

概述

1. 此文档主要描述Langchain-Chatchat项目的源码安装过程,项目版本为0.3.1

2. 使用ollama作为模型运行框架包括LLM和Embedding模型

3. LLM使用qwen:7b

环境准备

参考笔记《LLM基础环境准备》  

下载Langchain-Chatchat项目

# 拉取git仓库
git clone https://github.com/chatchat-space/Langchain-Chatchat.git

# 下载发布包(一般不使用)
wget https://github.com/chatchat-space/Langchain-Chatchat/archive/refs/tags/v0.3.1.zip
unzip v0.3.1.zip
mv Langchain-Chatchat-0.3.1 Langchain-Chatchat

创建conda环境和依赖管理包

conda create -n langchain-chat python==3.9
source .bashrc
cd Langchain-Chatchat
conda activate langchain-chat
pip install poetry
#  使用如下命令使 Poetry 使用 virtualenv python environment
poetry config virtualenvs.prefer-active-python true

安装依赖包

cd
cd  Langchain-Chatchat/libs/chatchat-server/
poetry install --with lint,test -E xinference
pip install "unstructured[pdf]"
sudo yum install mesa-libGL -y

设置源代码根目录

cd
cd Langchain-Chatchat/libs/chatchat-server
export CHATCHAT_ROOT=$HOME/Langchain-Chatchat/libs/chatchat-server

初始化项目配置文件和数据目录

cd
cd  Langchain-Chatchat/libs/chatchat-server/
python chatchat/cli.py init -x ollama -l qwen:7b -e bge-large-zh-v1.5

初始化知识库

cd
cd  Langchain-Chatchat/libs/chatchat-server/
python chatchat/cli.py kb --recreate-vs 

启动服务

cd
cd  Langchain-Chatchat/libs/chatchat-server/
nohup python chatchat/cli.py start -a > langchain.log 2>&1 &

FAQ 

更新开发部署环境依赖库

cd  Langchain-Chatchat/libs/chatchat-server/
# 更新pyproject.toml文件
# 执行更新操作
poetry build

将更新后的代码打包测试

# 如果需要对开发环境中代码打包成 Python 库并进行测试,可在主项目目录执行以下命令
poetry build

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

大叔比较胖

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值