Spaces:
Sleeping
Sleeping
MZhao commited on
Commit ·
5626813
1
Parent(s): 30b4af2
优化README内容与布局
Browse files
README.md
CHANGED
|
@@ -1,52 +1,54 @@
|
|
| 1 |
-
<
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
-
|
| 24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
|
| 26 |
## 目录
|
| 27 |
-
|[
|
| 28 |
-
| ---- | ---- | ---- | ---
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
## 功能
|
| 32 |
-
- [x] 像官方客户端那样支持实时显示回答!
|
| 33 |
-
- [x] 重试对话,让ChatGPT再回答一次。
|
| 34 |
-
- [x] 优化Tokens,减少Tokens占用,以支持更长的对话。
|
| 35 |
-
- [x] 设置System Prompt,有效地设定前置条件
|
| 36 |
-
- [x] 保存/加载对话历史记录
|
| 37 |
-
- [x] 在图形界面中添加API key
|
| 38 |
-
- [x] System Prompt模板功能,从预置的Prompt库中选择System Prompt
|
| 39 |
-
- [x] 实时显示Tokens用量
|
| 40 |
|
| 41 |
## 使用技巧
|
| 42 |
|
| 43 |
-
- 使用System Prompt可以很有效地设定前提条件
|
| 44 |
-
-
|
| 45 |
-
- 如果
|
| 46 |
-
-
|
| 47 |
-
-
|
| 48 |
-
-
|
| 49 |
-
- 在
|
|
|
|
| 50 |
<img width="300" alt="image" src="https://user-images.githubusercontent.com/51039745/223447310-e098a1f2-0dcf-48d6-bcc5-49472dd7ca0d.png">
|
| 51 |
|
| 52 |
## 安装方式
|
|
@@ -132,7 +134,9 @@
|
|
| 132 |
|
| 133 |
**如果你在安装过程中碰到了问题,请先查看[疑难杂症解决](#疑难杂症解决)部分。**
|
| 134 |
|
| 135 |
-
|
|
|
|
|
|
|
| 136 |
|
| 137 |
#### 拉取镜像
|
| 138 |
|
|
@@ -169,7 +173,7 @@ docker build -t chuanhuchatgpt:latest .
|
|
| 169 |
|
| 170 |
### 远程部署
|
| 171 |
|
| 172 |
-
<details><summary>如果需要在公网服务器部署本项目,请阅读
|
| 173 |
|
| 174 |
### 部署到公网服务器
|
| 175 |
|
|
@@ -234,9 +238,11 @@ map $http_upgrade $connection_upgrade {
|
|
| 234 |
|
| 235 |
</details>
|
| 236 |
|
|
|
|
|
|
|
| 237 |
## 疑难杂症解决
|
| 238 |
|
| 239 |
-
首先,请尝试拉取本项目的最新更改,使用最新的代码重试。
|
| 240 |
|
| 241 |
点击网页上的 `Download ZIP` 下载最新代码,或
|
| 242 |
```shell
|
|
@@ -251,7 +257,9 @@ pip install gradio --upgrade --force-reinstall
|
|
| 251 |
|
| 252 |
很多时候,这样就可以解决问题。
|
| 253 |
|
| 254 |
-
|
|
|
|
|
|
|
| 255 |
|
| 256 |
> 部署在CentOS7.6,Python3.11.0上,最后报错ModuleNotFoundError: No module named '_bz2'
|
| 257 |
|
|
@@ -262,7 +270,7 @@ sudo yum install bzip2-devel
|
|
| 262 |
```
|
| 263 |
</details>
|
| 264 |
|
| 265 |
-
<details><summary><
|
| 266 |
|
| 267 |
> 如果有人也出现了`openai.error.APIConnectionError`提示的报错,那可能是`urllib3`的版本导致的。`urllib3`版本大于`1.25.11`,就会出现这个问题。
|
| 268 |
>
|
|
@@ -286,14 +294,14 @@ pip install urllib3==1.25.11
|
|
| 286 |
[解决OpenAI API 挂了代理还是连接不上的问题](https://zhuanlan.zhihu.com/p/611080662)
|
| 287 |
</details>
|
| 288 |
|
| 289 |
-
<details><summary><
|
| 290 |
|
| 291 |
> 在ChuanhuChatbot.py中设置APIkey后验证出错,提示“发生了未知错误Orz”
|
| 292 |
|
| 293 |
参见:[#26](https://github.com/GaiZhenbiao/ChuanhuChatGPT/issues/26)
|
| 294 |
</details>
|
| 295 |
|
| 296 |
-
<details><summary><
|
| 297 |
|
| 298 |
> 更新脚本文件后,SSLError [#49](https://github.com/GaiZhenbiao/ChuanhuChatGPT/issues/49)
|
| 299 |
>
|
|
@@ -330,7 +338,7 @@ DOMAIN-SUFFIX,openai.com,你的代理规则
|
|
| 330 |
```
|
| 331 |
</details>
|
| 332 |
|
| 333 |
-
<details><summary><
|
| 334 |
|
| 335 |
> ```
|
| 336 |
> Something went wrong
|
|
@@ -340,7 +348,7 @@ DOMAIN-SUFFIX,openai.com,你的代理规则
|
|
| 340 |
出现这个错误的原因是`127.0.0.1`被代理了,导致网页无法和后端通信。请设置代理软件,将`127.0.0.1`加入直连。
|
| 341 |
</details>
|
| 342 |
|
| 343 |
-
<details><summary><
|
| 344 |
|
| 345 |
`openai`这个依赖已经被移除了。请尝试下载最新版脚本。
|
| 346 |
</details>
|
|
|
|
| 1 |
+
<h1 align="center">川虎 ChatGPT 🐯 Chuanhu ChatGPT</h1>
|
| 2 |
+
<div align="center">
|
| 3 |
+
<a href="https://github.com/GaiZhenBiao/ChuanhuChatGPT">
|
| 4 |
+
<img src="https://user-images.githubusercontent.com/51039745/222689546-7612df0e-e28b-4693-9f5f-4ef2be3daf48.png" alt="Logo" height="156">
|
| 5 |
+
</a>
|
| 6 |
+
|
| 7 |
+
<p align="center">
|
| 8 |
+
<h3>为ChatGPT API提供了一个轻快好用的Web图形界面</h3>
|
| 9 |
+
<p align="center">
|
| 10 |
+
<a href="https://github.com/GaiZhenbiao/ChuanhuChatGPT/blob/main/LICENSE">
|
| 11 |
+
<img alt="Tests Passing" src="https://img.shields.io/github/license/GaiZhenbiao/ChuanhuChatGPT" />
|
| 12 |
+
</a>
|
| 13 |
+
<a href="https://gradio.app/">
|
| 14 |
+
<img alt="GitHub Contributors" src="https://img.shields.io/badge/Base-Gradio-fb7d1a?style=flat" />
|
| 15 |
+
</a>
|
| 16 |
+
<a href="https://github.com/GaiZhenBiao/ChuanhuChatGPT/graphs/contributors">
|
| 17 |
+
<img alt="GitHub Contributors" src="https://img.shields.io/github/contributors/GaiZhenBiao/ChuanhuChatGPT" />
|
| 18 |
+
</a>
|
| 19 |
+
<a href="https://github.com/GaiZhenBiao/ChuanhuChatGPT/issues">
|
| 20 |
+
<img alt="Issues" src="https://img.shields.io/github/issues/GaiZhenBiao/ChuanhuChatGPT?color=0088ff" />
|
| 21 |
+
</a>
|
| 22 |
+
<a href="https://github.com/GaiZhenBiao/ChuanhuChatGPT/pulls">
|
| 23 |
+
<img alt="GitHub pull requests" src="https://img.shields.io/github/issues-pr/GaiZhenBiao/ChuanhuChatGPT?color=0088ff" />
|
| 24 |
+
</a>
|
| 25 |
+
<br/>
|
| 26 |
+
<em>实时回复 / 无限对话 / 保存对话记录 / 渲染公式代码 / 联网搜索 / 预设Prompt集 / 实时Tokens显示</em>
|
| 27 |
+
<br/>
|
| 28 |
+
<a href="https://www.bilibili.com/video/BV1mo4y1r7eE"><strong>视频教程</strong></a>
|
| 29 |
+
·
|
| 30 |
+
<a href="https://huggingface.co/spaces/JohnSmith9982/ChuanhuChatGPT"><strong>在线体验</strong></a>
|
| 31 |
+
</p>
|
| 32 |
+
<p align="center">
|
| 33 |
+
<img alt="Animation Demo" src="https://user-images.githubusercontent.com/51039745/223148794-f4fd2fcb-3e48-4cdf-a759-7aa463d3f14c.gif" />
|
| 34 |
+
</p>
|
| 35 |
+
</p>
|
| 36 |
+
</div>
|
| 37 |
|
| 38 |
## 目录
|
| 39 |
+
|[使用技巧](#使用技巧)|[安装方式](#安装方式)|[疑难杂症解决](#疑难杂症解决)| [给作者买可乐🥤](#捐款) |
|
| 40 |
+
| ---- | ---- | ---- | --- |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
|
| 42 |
## 使用技巧
|
| 43 |
|
| 44 |
+
- 使用System Prompt可以很有效地设定前提条件。
|
| 45 |
+
- 使用Prompt模板功能时,选择Prompt模板集合文件,然后从下拉菜单中选择想要的prompt。
|
| 46 |
+
- 如果回答不满意,可以使用`重新生成`按钮再试一次
|
| 47 |
+
- 对于长对话,可以使用`优化Tokens`按钮减少Tokens占用。
|
| 48 |
+
- 输入框支持换行,按`shift enter`即可。
|
| 49 |
+
- 部署到服务器:将程序最后一句改成`demo.launch(server_name="0.0.0.0", server_port=<你的端口号>)`。
|
| 50 |
+
- 获取公共链接:将程序最后一句改成`demo.launch(share=True)`。注意程序必须在运行,才能通过公共链接访问。
|
| 51 |
+
- 在Hugging Face上使用:建议在右上角 **复制Space** 再使用,这样能大大减少排队时间,App反应也会更加迅速。
|
| 52 |
<img width="300" alt="image" src="https://user-images.githubusercontent.com/51039745/223447310-e098a1f2-0dcf-48d6-bcc5-49472dd7ca0d.png">
|
| 53 |
|
| 54 |
## 安装方式
|
|
|
|
| 134 |
|
| 135 |
**如果你在安装过程中碰到了问题,请先查看[疑难杂症解决](#疑难杂症解决)部分。**
|
| 136 |
|
| 137 |
+
### 使用Docker运行
|
| 138 |
+
|
| 139 |
+
<details><summary>如果觉得以上方法比较麻烦,我们提供了Docker镜像</summary>
|
| 140 |
|
| 141 |
#### 拉取镜像
|
| 142 |
|
|
|
|
| 173 |
|
| 174 |
### 远程部署
|
| 175 |
|
| 176 |
+
<details><summary>如果需要在公网服务器部署本项目,请阅读该部分</summary>
|
| 177 |
|
| 178 |
### 部署到公网服务器
|
| 179 |
|
|
|
|
| 238 |
|
| 239 |
</details>
|
| 240 |
|
| 241 |
+
---
|
| 242 |
+
|
| 243 |
## 疑难杂症解决
|
| 244 |
|
| 245 |
+
首先,请先尝试拉取本项目的最新更改,使用最新的代码重试。
|
| 246 |
|
| 247 |
点击网页上的 `Download ZIP` 下载最新代码,或
|
| 248 |
```shell
|
|
|
|
| 257 |
|
| 258 |
很多时候,这样就可以解决问题。
|
| 259 |
|
| 260 |
+
### 常见问题
|
| 261 |
+
|
| 262 |
+
<details><summary><code>No module named '_bz2'</code></summary>
|
| 263 |
|
| 264 |
> 部署在CentOS7.6,Python3.11.0上,最后报错ModuleNotFoundError: No module named '_bz2'
|
| 265 |
|
|
|
|
| 270 |
```
|
| 271 |
</details>
|
| 272 |
|
| 273 |
+
<details><summary><code>openai.error.APIConnectionError</code></summary>
|
| 274 |
|
| 275 |
> 如果有人也出现了`openai.error.APIConnectionError`提示的报错,那可能是`urllib3`的版本导致的。`urllib3`版本大于`1.25.11`,就会出现这个问题。
|
| 276 |
>
|
|
|
|
| 294 |
[解决OpenAI API 挂了代理还是连接不上的问题](https://zhuanlan.zhihu.com/p/611080662)
|
| 295 |
</details>
|
| 296 |
|
| 297 |
+
<details><summary><code>在 Python 文件里 设定 API Key 之后验证失败</code></summary>
|
| 298 |
|
| 299 |
> 在ChuanhuChatbot.py中设置APIkey后验证出错,提示“发生了未知错误Orz”
|
| 300 |
|
| 301 |
参见:[#26](https://github.com/GaiZhenbiao/ChuanhuChatGPT/issues/26)
|
| 302 |
</details>
|
| 303 |
|
| 304 |
+
<details><summary><code>一直等待/SSL Error</code></summary>
|
| 305 |
|
| 306 |
> 更新脚本文件后,SSLError [#49](https://github.com/GaiZhenbiao/ChuanhuChatGPT/issues/49)
|
| 307 |
>
|
|
|
|
| 338 |
```
|
| 339 |
</details>
|
| 340 |
|
| 341 |
+
<details><summary><code>网页提示错误 Something went wrong</code></summary>
|
| 342 |
|
| 343 |
> ```
|
| 344 |
> Something went wrong
|
|
|
|
| 348 |
出现这个错误的原因是`127.0.0.1`被代理了,导致网页无法和后端通信。请设置代理软件,将`127.0.0.1`加入直连。
|
| 349 |
</details>
|
| 350 |
|
| 351 |
+
<details><summary><code>No matching distribution found for openai>=0.27.0</code></summary>
|
| 352 |
|
| 353 |
`openai`这个依赖已经被移除了。请尝试下载最新版脚本。
|
| 354 |
</details>
|