update README.md
This commit is contained in:
parent
811d5a2e46
commit
57d78bd1f6
24
README.md
24
README.md
|
|
@ -20,7 +20,7 @@
|
||||||
|
|
||||||
## 变更日志
|
## 变更日志
|
||||||
|
|
||||||
参见 [变更日志](CHANGELOG.md)。
|
参见 [变更日志](docs/CHANGELOG.md)。
|
||||||
|
|
||||||
## 使用方式
|
## 使用方式
|
||||||
|
|
||||||
|
|
@ -42,9 +42,13 @@
|
||||||
|
|
||||||
本项目已在 Python 3.8,CUDA 11.7 环境下完成测试。
|
本项目已在 Python 3.8,CUDA 11.7 环境下完成测试。
|
||||||
|
|
||||||
|
### 从本地加载模型
|
||||||
|
|
||||||
|
请参考 [THUDM/ChatGLM-6B#从本地加载模型](https://github.com/THUDM/ChatGLM-6B#从本地加载模型)
|
||||||
|
|
||||||
### 1. 安装环境
|
### 1. 安装环境
|
||||||
|
|
||||||
参见 [安装指南](INSTALL.md)。
|
参见 [安装指南](docs/INSTALL.md)。
|
||||||
|
|
||||||
### 2. 设置模型默认参数
|
### 2. 设置模型默认参数
|
||||||
|
|
||||||
|
|
@ -52,7 +56,14 @@
|
||||||
|
|
||||||
### 3. 执行脚本体验 Web UI 或命令行交互
|
### 3. 执行脚本体验 Web UI 或命令行交互
|
||||||
|
|
||||||
执行 [webui.py](webui.py) 脚本体验 **Web 交互**
|
> 注:鉴于环境部署过程中可能遇到问题,建议首先测试命令行脚本。建议命令行脚本测试可正常运行后再运行 Web UI。
|
||||||
|
|
||||||
|
执行 [knowledge_based_chatglm.py](cli_demo.py) 脚本体验**命令行交互**:
|
||||||
|
```shell
|
||||||
|
$ python cli_demo.py
|
||||||
|
```
|
||||||
|
|
||||||
|
或执行 [webui.py](webui.py) 脚本体验 **Web 交互**
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
$ python webui.py
|
$ python webui.py
|
||||||
|
|
@ -68,14 +79,9 @@ Web UI 可以实现如下功能:
|
||||||
2. 可手动调节保留对话历史长度,可根据显存大小自行调节;
|
2. 可手动调节保留对话历史长度,可根据显存大小自行调节;
|
||||||
3. 添加上传文件功能,通过下拉框选择已上传的文件,点击`加载文件`按钮,过程中可随时更换加载的文件。
|
3. 添加上传文件功能,通过下拉框选择已上传的文件,点击`加载文件`按钮,过程中可随时更换加载的文件。
|
||||||
|
|
||||||
或执行 [knowledge_based_chatglm.py](cli_demo.py) 脚本体验**命令行交互**:
|
|
||||||
```shell
|
|
||||||
$ python knowledge_based_chatglm.py
|
|
||||||
```
|
|
||||||
|
|
||||||
### 常见问题
|
### 常见问题
|
||||||
|
|
||||||
参见 [常见问题](FAQ.md)。
|
参见 [常见问题](docs/FAQ.md)。
|
||||||
|
|
||||||
## Demo
|
## Demo
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
**[2023/04/15]**
|
**[2023/04/15]**
|
||||||
|
|
||||||
1. 重构项目结构,在根目录下保留命令行 Demo [cli_demo.py](cli_demo.py) 和 Web UI Demo [webui.py](webui.py);
|
1. 重构项目结构,在根目录下保留命令行 Demo [cli_demo.py](../cli_demo.py) 和 Web UI Demo [webui.py](../webui.py);
|
||||||
2. 对 Web UI 进行改进,修改为运行 Web UI 后首先按照 [configs/model_config.py](configs/model_config.py) 默认选项加载模型,并增加报错提示信息等;
|
2. 对 Web UI 进行改进,修改为运行 Web UI 后首先按照 [configs/model_config.py](../configs/model_config.py) 默认选项加载模型,并增加报错提示信息等;
|
||||||
3. 对常见问题进行补充说明。
|
3. 对常见问题进行补充说明。
|
||||||
|
|
||||||
**[2023/04/12]**
|
**[2023/04/12]**
|
||||||
|
|
@ -6,6 +6,18 @@ A1: 目前已测试支持 txt、docx、md、pdf 格式文件,更多文件格
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
Q2: 执行 `pip install -r requirements.txt` 过程中,安装 `detectron2` 时发生报错怎么办?
|
||||||
|
|
||||||
|
A2: 如果不需要对 `pdf` 格式文件读取,可不安装 `detectron2`;如需对 `pdf` 文件进行高精度文本提取,建议按照如下方法安装:
|
||||||
|
|
||||||
|
```commandline
|
||||||
|
$ git clone https://github.com/facebookresearch/detectron2.git
|
||||||
|
$ cd detectron2
|
||||||
|
$ pip install -e .
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
Q3: 使用过程中 Python 包`nltk`发生了`Resource punkt not found.`报错,该如何解决?
|
Q3: 使用过程中 Python 包`nltk`发生了`Resource punkt not found.`报错,该如何解决?
|
||||||
|
|
||||||
A3: https://github.com/nltk/nltk_data/raw/gh-pages/packages/tokenizers/punkt.zip 中的 `packages/tokenizers` 解压,放到 `nltk_data/tokenizers` 存储路径下。
|
A3: https://github.com/nltk/nltk_data/raw/gh-pages/packages/tokenizers/punkt.zip 中的 `packages/tokenizers` 解压,放到 `nltk_data/tokenizers` 存储路径下。
|
||||||
|
|
@ -31,7 +43,7 @@ A5: 可以尝试使用 chatglm-6b-int4 模型在 colab 中运行,需要注意
|
||||||
|
|
||||||
Q6: 在 Anaconda 中使用 pip 安装包无效如何解决?
|
Q6: 在 Anaconda 中使用 pip 安装包无效如何解决?
|
||||||
|
|
||||||
A6: 此问题是系统环境问题,详细见 [在Anaconda中使用pip安装包无效问题](docs/在Anaconda中使用pip安装包无效问题.md)
|
A6: 此问题是系统环境问题,详细见 [在Anaconda中使用pip安装包无效问题](在Anaconda中使用pip安装包无效问题.md)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
@ -70,7 +82,7 @@ A8: 可使用本项目用到的模型权重文件百度网盘地址:
|
||||||
|
|
||||||
Q9: 下载完模型后,如何修改代码以执行本地模型?
|
Q9: 下载完模型后,如何修改代码以执行本地模型?
|
||||||
|
|
||||||
A9: 模型下载完成后,请在 [configs/model_config.py](configs/model_config.py) 文件中,对`embedding_model_dict`和`llm_model_dict`参数进行修改,如把`llm_model_dict`从
|
A9: 模型下载完成后,请在 [configs/model_config.py](../configs/model_config.py) 文件中,对`embedding_model_dict`和`llm_model_dict`参数进行修改,如把`llm_model_dict`从
|
||||||
|
|
||||||
```json
|
```json
|
||||||
embedding_model_dict = {
|
embedding_model_dict = {
|
||||||
Loading…
Reference in New Issue