Merge branch 'master' into dev

This commit is contained in:
hzg0601 2023-08-14 11:39:12 +08:00
commit 0d6a9cf8f3
4 changed files with 25 additions and 21 deletions

View File

@ -46,6 +46,7 @@
🐳 [Docker 镜像](registry.cn-beijing.aliyuncs.com/chatchat/chatchat:0.2.0)
💻 一行命令运行 Docker
```shell
docker run -d --gpus all -p 80:8501 registry.cn-beijing.aliyuncs.com/chatchat/chatchat:0.2.0
```
@ -56,7 +57,7 @@ docker run -d --gpus all -p 80:8501 registry.cn-beijing.aliyuncs.com/chatchat/ch
参见 [版本更新日志](https://github.com/imClumsyPanda/langchain-ChatGLM/releases)。
从`0.1.x`升级过来的用户请注意,在完成[“开发部署 3 设置配置项”](docs/INSTALL.md)之后,需要将现有知识库迁移到新格式,具体见[知识库初始化与迁移](docs/INSTALL.md#知识库初始化与迁移)。
`0.1.x`升级过来的用户请注意,在完成[“开发部署 3 设置配置项”](docs/INSTALL.md)之后,需要将现有知识库迁移到新格式,具体见[知识库初始化与迁移](docs/INSTALL.md#知识库初始化与迁移)。
### `0.2.0` 版本与 `0.1.x` 版本区别
@ -147,7 +148,7 @@ docker run -d --gpus all -p 80:8501 registry.cn-beijing.aliyuncs.com/chatchat/ch
- 该版本目标为方便一键部署使用请确保您已经在Linux发行版上安装了NVIDIA驱动程序
- 请注意您不需要在主机系统上安装CUDA工具包但需要安装 `NVIDIA Driver` 以及 `NVIDIA Container Toolkit`,请参考[安装指南](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html)
- 首次拉取和启动均需要一定时间,首次启动时请参照下图使用 `docker logs -f <container id>` 查看日志
- 如遇到启动过程卡在 `Waiting..` 步骤,建议使用`docker exec -it <container id> bash` 进入 `/logs/` 目录查看对应阶段日志
- 如遇到启动过程卡在 `Waiting..` 步骤,建议使用 `docker exec -it <container id> bash` 进入 `/logs/` 目录查看对应阶段日志
---
@ -161,8 +162,7 @@ docker run -d --gpus all -p 80:8501 registry.cn-beijing.aliyuncs.com/chatchat/ch
参见 [开发环境准备](docs/INSTALL.md)。
**请注意:** `0.2.0`及更新版本的依赖包与`0.1.x`版本依赖包可能发生冲突,强烈建议新建环境后重新安装依赖包。
**请注意:** `0.2.0`及更新版本的依赖包与 `0.1.x`版本依赖包可能发生冲突,强烈建议新建环境后重新安装依赖包。
### 2. 下载模型至本地
@ -209,11 +209,12 @@ embedding_model_dict = {
当前项目的知识库信息存储在数据库中,在正式运行项目之前请先初始化数据库(我们强烈建议您在执行操作前备份您的知识文件)。
- 如果您是从 `0.1.x` 版本升级过来的用户针对已建立的知识库请确认知识库的向量库类型、Embedding 模型 `configs/model_config.py` 中默认设置一致,如无变化只需以下命令将现有知识库信息添加到数据库即可:
```shell
$ python init_database.py
```
- 如果您是第一次运行本项目,知识库尚未建立,或者配置文件中的知识库类型、嵌入模型发生变化,需要以下命令初始化或重建知识库:
```shell
$ python init_database.py --recreate-vs
```
@ -236,6 +237,9 @@ $ python server/llm_api_shutdown.py --serve all
亦可单独停止一个 fastchat 服务模块,可选 [`all`, `controller`, `model_worker`, `openai_api_server`]
项目支持多卡加载需在llm_api.py中修改create_model_worker_app函数中修改gpus=None,num_gpus=1,max_gpu_memory="20GiB",三个参数其中gpus控制使用的卡的ID如果“0,1", num_gpus控制使用的卡数max_gpu_memory控制每个卡使用的显存容量。
#### 5.2 启动 API 服务
启动 **LLM 服务**后,执行 [server/api.py](server/api.py) 脚本启动 **API** 服务
@ -252,13 +256,13 @@ $ python server/api.py
#### 5.3 启动 Web UI 服务
执行 [webui.py](webui.py) 启动 **Web UI** 服务(默认使用端口`8501`
执行 [webui.py](webui.py) 启动 **Web UI** 服务(默认使用端口 `8501`
```shell
$ streamlit run webui.py
```
使用 Langchain-Chatchat 主题色启动 **Web UI** 服务(默认使用端口`8501`
使用 Langchain-Chatchat 主题色启动 **Web UI** 服务(默认使用端口 `8501`
```shell
$ streamlit run webui.py --theme.base "light" --theme.primaryColor "#165dff" --theme.secondaryBackgroundColor "#f5f5f5" --theme.textColor "#000000"
@ -273,7 +277,6 @@ $ streamlit run webui.py --server.port 666
- Web UI 对话界面:
![](img/webui_0813_0.png)
- Web UI 知识库管理页面:
![](img/webui_0813_1.png)
@ -308,11 +311,11 @@ $ streamlit run webui.py --server.port 666
- [X] Bing 搜索
- [X] DuckDuckGo 搜索
- [ ] Agent 实现
- [x] LLM 模型接入
- [x] 支持通过调用 [fastchat](https://github.com/lm-sys/FastChat) api 调用 llm
- [X] LLM 模型接入
- [X] 支持通过调用 [fastchat](https://github.com/lm-sys/FastChat) api 调用 llm
- [ ] 支持 ChatGLM API 等 LLM API 的接入
- [X] Embedding 模型接入
- [x] 支持调用 HuggingFace 中各开源 Emebdding 模型
- [X] 支持调用 HuggingFace 中各开源 Emebdding 模型
- [ ] 支持 OpenAI Embedding API 等 Embedding API 的接入
- [X] 基于 FastAPI 的 API 方式调用
- [X] Web UI
@ -322,6 +325,6 @@ $ streamlit run webui.py --server.port 666
## 项目交流群
<img src="img/qr_code_50.jpg" alt="二维码" width="300" height="300" />
<img src="img/qr_code_51.jpg" alt="二维码" width="300" height="300" />
🎉 langchain-ChatGLM 项目微信交流群,如果你也对本项目感兴趣,欢迎加入群聊参与讨论交流。

BIN
img/qr_code_51.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 284 KiB

View File

@ -44,7 +44,7 @@ def create_model_worker_app(
gptq_act_order=None,
gpus=None,
num_gpus=1,
max_gpu_memory=None,
max_gpu_memory="20GiB",
cpu_offloading=None,
worker_address=base_url.format(model_worker_port),
controller_address=base_url.format(controller_port),

View File

@ -76,6 +76,7 @@ parser.add_argument("--num-gpus", type=int, default=1)
parser.add_argument(
"--max-gpu-memory",
type=str,
default="20GiB",
help="The maximum memory per gpu. Use a string like '13Gib'",
)
parser.add_argument(