Langchain-chatchat接入百川2手册

一、下载源码

github下载最新版本,git地址如下:

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

二、安装依赖

cd Langchain-Chatchat
pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install zhipuai
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple Xformers

三、安装模型文件

共享目录中已存在模型,如果新机器的话需重新下载

1) 下载百川2模型文件,模型文件放在/opt/unicloud/share目录,完整目录应为

/opt/unicloud/share/Baichuan2-13B/Baichuan2-13B-Chat

如需自定义目录,需修改下面的model_config.py 对应地址

2) 下载m3e-base模型文件,存放目录为

/opt/unicloud/share/wenda-source/wenda/model/m3e-base

如需自定义目录,需修改下面的model_config.py 对应地址

四、设置配置项

复制configs/model_config.py.example 并重命名为 model_config.py。

复制configs/server_config.py.example 并重命名为 server_config.py。

需跟据实际情况修改ip 10.0.53.21 示例如下:

import os
import logging
# 日志格式
LOG_FORMAT = "%(asctime)s - %(filename)s[line:%(lineno)d] - %(levelname)s: %(message)s"
logger = logging.getLogger()
logger.setLevel(logging.INFO)
logging.basicConfig(format=LOG_FORMAT)
# 是否显示详细日志
log_verbose = False


# 在以下字典中修改属性值,以指定本地embedding模型存储位置
# 如将 "text2vec": "GanymedeNil/text2vec-large-chinese" 修改为 "text2vec": "User/Downloads/text2vec-large-chinese"
# 此处请写绝对路径
embedding_model_dict = {
    #"ernie-tiny": "nghuyong/ernie-3.0-nano-zh",
    #"ernie-base": "nghuyong/ernie-3.0-base-zh",
    #"text2vec-base": "shibing624/text2vec-base-chinese",
    "text2vec": "/opt/unicloud/share/wenda-source/wenda/model/text2vec-large-chinese",
    #"text2vec-paraphrase": "shibing624/text2vec-base-chinese-paraphrase",
    #"text2vec-sentence": "shibing624/text2vec-base-chinese-sentence",
    #"text2vec-multilingual": "shibing624/text2vec-base-multilingual",
    #"text2vec-bge-large-chinese": "shibing624/text2vec-bge-large-chinese",
    #"m3e-small": "moka-ai/m3e-small",
    "m3e-base": "/opt/unicloud/share
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值