本地部署 川虎 Chat

1. 川虎 Chat 项目概述

为ChatGPT等多种LLM提供了一个轻快好用的Web图形界面和众多附加功能。

支持 GPT-4 · 基于文件问答 · LLM本地部署 · 联网搜索 · Agent 助理 · 支持 Fine-tune

2. Github 地址

https://github.com/GaiZhenbiao/ChuanhuChatGPT

3. 部署 川虎 Chat

(可选)设置 Python 安装默认源,

pip config set global.index-url http://mirrors.aliyun.com/pypi/simple/

创建虚拟环境,

conda create -n chuanhu_chat python=3.10 -y
conda activate chuanhu_chat 

克隆项目,

git clone https://github.com/GaiZhenbiao/ChuanhuChatGPT.git; cd ChuanhuChatGPT

安装依赖,

pip install torch==2.0.0+cu118 torchvision==0.15.1+cu118 torchaudio==2.0.1 --index-url https://download.pytorch.org/whl/cu118
pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/
pip install -r requirements_advanced.txt -i https://mirrors.aliyun.com/pypi/simple/

4. 配置 config.json

您也可以略过本步骤,在第四步启动后直接在图形界面中填写您的API密钥。不过,如果您为自己或熟人部署 川虎Chat,我们建议您在这一步设定默认密钥、用户名密码以及更多设置。这样设置的密钥以及其他设置项可以在拉取项目更新之后保留。

在项目文件夹中复制一份 config_example.json,并将其重命名为 config.json,

cp config_example.json config.json

在其中填入 API-Key、用户名密码(可选)、API host(可选)、代理地址(可选)等设置。用户名密码支持多用户。示例:

{
   "openai_api_key": "sk-xxxxxxxxxxxxxxxxxxxxxxxxx",
   "users": [
      ["用户1的用户名", "用户1的密码"],
      ["用户2的用户名", "用户2的密码"]
   ],
}

更多项目配置说明请查看 配置 config.json

5. 启动 川虎 Chat

python ChuanhuChatbot.py

如果一切顺利,现在,你应该已经可以在浏览器地址栏中输入 http://localhost:7860 查看并使用 川虎Chat 了。

完结!

猜你喜欢

转载自blog.csdn.net/engchina/article/details/133417296