Spaces:
Sleeping
Sleeping
Chuan Hu
commited on
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<img height="128" align="left" src="https://user-images.githubusercontent.com/51039745/222689546-7612df0e-e28b-4693-9f5f-4ef2be3daf48.png" alt="Logo">
|
| 2 |
|
| 3 |
-
# 川虎 ChatGPT
|
| 4 |
|
| 5 |
[](https://github.com/GaiZhenbiao/ChuanhuChatGPT/blob/main/LICENSE)
|
| 6 |
[](https://gradio.app/)
|
|
@@ -13,7 +13,7 @@
|
|
| 13 |

|
| 14 |
|
| 15 |
|
| 16 |
-
## 🎉🎉🎉
|
| 17 |
|
| 18 |
- 精简了UI
|
| 19 |
- 像官方ChatGPT那样实时回复
|
|
@@ -21,6 +21,10 @@
|
|
| 21 |
- 从Prompt模板中选择预设
|
| 22 |
- 将大段代码显示在代码块中
|
| 23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
|
| 25 |
## 功能
|
| 26 |
- [x] 像官方客户端那样支持实时显示回答!
|
|
@@ -50,12 +54,20 @@
|
|
| 50 |
|
| 51 |
### 填写API密钥
|
| 52 |
|
|
|
|
|
|
|
|
|
|
| 53 |
#### 在图形界面中填写你的API密钥
|
| 54 |
|
| 55 |
这样设置的密钥会在页面刷新后被清除
|
| 56 |
|
| 57 |
<img width="760" alt="image" src="https://user-images.githubusercontent.com/51039745/222873756-3858bb82-30b9-49bc-9019-36e378ee624d.png">
|
| 58 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
|
| 60 |
#### ……或者在代码中填入你的 OpenAI API 密钥
|
| 61 |
|
|
@@ -63,6 +75,14 @@
|
|
| 63 |
|
| 64 |
<img width="525" alt="image" src="https://user-images.githubusercontent.com/51039745/223440375-d472de4b-aa7f-4eae-9170-6dc2ed9f5480.png">
|
| 65 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 66 |
### 安装依赖
|
| 67 |
|
| 68 |
```
|
|
@@ -93,15 +113,21 @@ python3 ChuanhuChatbot.py
|
|
| 93 |
|
| 94 |
如果还是不行,请先[安装Python](https://www.runoob.com/python/python-install.html)。
|
| 95 |
|
| 96 |
-
|
|
|
|
|
|
|
|
|
|
| 97 |
|
| 98 |
-
|
|
|
|
|
|
|
|
|
|
| 99 |
|
| 100 |
```
|
| 101 |
docker pull tuchuanhuhuhu/chuanhuchatgpt:latest
|
| 102 |
```
|
| 103 |
|
| 104 |
-
|
| 105 |
|
| 106 |
```
|
| 107 |
docker run -d --name chatgpt \
|
|
@@ -111,20 +137,26 @@ docker run -d --name chatgpt \
|
|
| 111 |
tuchuanhuhuhu/chuanhuchatgpt:latest
|
| 112 |
```
|
| 113 |
|
| 114 |
-
|
| 115 |
```
|
| 116 |
docker logs chatgpt
|
| 117 |
```
|
| 118 |
|
| 119 |
-
|
| 120 |
|
| 121 |
```
|
| 122 |
docker build -t chuanhuchatgpt:latest .
|
| 123 |
```
|
| 124 |
|
|
|
|
|
|
|
|
|
|
| 125 |
|
| 126 |
## 部署相关
|
| 127 |
|
|
|
|
|
|
|
|
|
|
| 128 |
### 部署到公网服务器
|
| 129 |
|
| 130 |
将最后一句修改为
|
|
@@ -180,11 +212,17 @@ map $http_upgrade $connection_upgrade {
|
|
| 180 |
}
|
| 181 |
```
|
| 182 |
|
|
|
|
|
|
|
|
|
|
| 183 |
## 疑难杂症解决
|
| 184 |
|
| 185 |
|
| 186 |
### No module named '_bz2'
|
| 187 |
|
|
|
|
|
|
|
|
|
|
| 188 |
太空急先锋:部署在CentOS7.6,Python3.11.0上,最后报错ModuleNotFoundError: No module named '_bz2'
|
| 189 |
|
| 190 |
解决方案:安装python前得下个bzip编译环境
|
|
@@ -216,11 +254,8 @@ pip install urllib3==1.25.11
|
|
| 216 |
参考自:
|
| 217 |
[解决OpenAI API 挂了代理还是连接不上的问题](https://zhuanlan.zhihu.com/p/611080662)
|
| 218 |
|
| 219 |
-
|
| 220 |
-
|
| 221 |
-
建议把`openai.com`加入Clash等软件的分流规则中。
|
| 222 |
-
|
| 223 |
-
跑起来之后,输入问题好像就没反应了,也没报错 [#25](https://github.com/GaiZhenbiao/ChuanhuChatGPT/issues/25)
|
| 224 |
|
| 225 |
### 在 Python 文件里 设定 API Key 之后验证失败
|
| 226 |
|
|
@@ -228,14 +263,25 @@ pip install urllib3==1.25.11
|
|
| 228 |
|
| 229 |
### 重装 gradio
|
| 230 |
|
|
|
|
|
|
|
|
|
|
| 231 |
很多时候,这样就可以解决问题。
|
| 232 |
|
| 233 |
```
|
| 234 |
pip install gradio --upgrade --force-reinstall
|
| 235 |
```
|
| 236 |
|
|
|
|
|
|
|
|
|
|
| 237 |
### 一直等待/SSL Error [#49](https://github.com/GaiZhenbiao/ChuanhuChatGPT/issues/49)
|
| 238 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 239 |
```
|
| 240 |
requests.exceptions.SSLError: HTTPSConnectionPool(host='api.openai.com', port=443): Max retries exceeded with url: /v1/chat/completions (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1129)')))
|
| 241 |
```
|
|
@@ -258,7 +304,13 @@ DOMAIN,127.0.0.1,DIRECT
|
|
| 258 |
DOMAIN-SUFFIX,openai.com,你的代理规则
|
| 259 |
```
|
| 260 |
|
| 261 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 262 |
|
| 263 |
```
|
| 264 |
Something went wrong
|
|
@@ -267,6 +319,9 @@ Expecting value: 1ine 1 column 1 (char o)
|
|
| 267 |
|
| 268 |
出现这个错误的原因是`127.0.0.1`被代理了,导致网页无法和后端通信。请设置代理软件,将`127.0.0.1`加入直连。
|
| 269 |
|
|
|
|
|
|
|
|
|
|
| 270 |
### No matching distribution found for openai>=0.27.0
|
| 271 |
|
| 272 |
`openai`这个依赖已经被移除了。请尝试下载最新版脚本。
|
|
@@ -280,3 +335,10 @@ Expecting value: 1ine 1 column 1 (char o)
|
|
| 280 |
<a href="https://github.com/GaiZhenbiao/ChuanhuChatGPT/graphs/contributors">
|
| 281 |
<img src="https://contrib.rocks/image?repo=GaiZhenbiao/ChuanhuChatGPT" />
|
| 282 |
</a>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
<img height="128" align="left" src="https://user-images.githubusercontent.com/51039745/222689546-7612df0e-e28b-4693-9f5f-4ef2be3daf48.png" alt="Logo">
|
| 2 |
|
| 3 |
+
# 川虎 ChatGPT 🐯 Chuanhu ChatGPT
|
| 4 |
|
| 5 |
[](https://github.com/GaiZhenbiao/ChuanhuChatGPT/blob/main/LICENSE)
|
| 6 |
[](https://gradio.app/)
|
|
|
|
| 13 |

|
| 14 |
|
| 15 |
|
| 16 |
+
## 重大更新 🎉🎉🎉
|
| 17 |
|
| 18 |
- 精简了UI
|
| 19 |
- 像官方ChatGPT那样实时回复
|
|
|
|
| 21 |
- 从Prompt模板中选择预设
|
| 22 |
- 将大段代码显示在代码块中
|
| 23 |
|
| 24 |
+
## 目录
|
| 25 |
+
|[功能](#功能)|[使用技巧](#使用技巧)|[安装方式](#安装方式)|[疑难杂症解决](#疑难杂症解决)|
|
| 26 |
+
| ---- | ---- | ---- | ---- |
|
| 27 |
+
|
| 28 |
|
| 29 |
## 功能
|
| 30 |
- [x] 像官方客户端那样支持实时显示回答!
|
|
|
|
| 54 |
|
| 55 |
### 填写API密钥
|
| 56 |
|
| 57 |
+
<details><summary>在图形界面中填写你的API密钥</summary>
|
| 58 |
+
<p>
|
| 59 |
+
|
| 60 |
#### 在图形界面中填写你的API密钥
|
| 61 |
|
| 62 |
这样设置的密钥会在页面刷新后被清除
|
| 63 |
|
| 64 |
<img width="760" alt="image" src="https://user-images.githubusercontent.com/51039745/222873756-3858bb82-30b9-49bc-9019-36e378ee624d.png">
|
| 65 |
|
| 66 |
+
</p>
|
| 67 |
+
</details>
|
| 68 |
+
|
| 69 |
+
<details><summary>在代码中填入你的 OpenAI API 密钥</summary>
|
| 70 |
+
<p>
|
| 71 |
|
| 72 |
#### ……或者在代码中填入你的 OpenAI API 密钥
|
| 73 |
|
|
|
|
| 75 |
|
| 76 |
<img width="525" alt="image" src="https://user-images.githubusercontent.com/51039745/223440375-d472de4b-aa7f-4eae-9170-6dc2ed9f5480.png">
|
| 77 |
|
| 78 |
+
</p>
|
| 79 |
+
</details>
|
| 80 |
+
|
| 81 |
+
### 直接安装
|
| 82 |
+
|
| 83 |
+
<details>
|
| 84 |
+
<p>
|
| 85 |
+
|
| 86 |
### 安装依赖
|
| 87 |
|
| 88 |
```
|
|
|
|
| 113 |
|
| 114 |
如果还是不行,请先[安装Python](https://www.runoob.com/python/python-install.html)。
|
| 115 |
|
| 116 |
+
</p>
|
| 117 |
+
</details>
|
| 118 |
+
|
| 119 |
+
### 或者,使用Docker 运行
|
| 120 |
|
| 121 |
+
<details>
|
| 122 |
+
<p>
|
| 123 |
+
|
| 124 |
+
#### 拉取镜像
|
| 125 |
|
| 126 |
```
|
| 127 |
docker pull tuchuanhuhuhu/chuanhuchatgpt:latest
|
| 128 |
```
|
| 129 |
|
| 130 |
+
#### 运行
|
| 131 |
|
| 132 |
```
|
| 133 |
docker run -d --name chatgpt \
|
|
|
|
| 137 |
tuchuanhuhuhu/chuanhuchatgpt:latest
|
| 138 |
```
|
| 139 |
|
| 140 |
+
#### 查看运行状态
|
| 141 |
```
|
| 142 |
docker logs chatgpt
|
| 143 |
```
|
| 144 |
|
| 145 |
+
#### 也可修改脚本后手动构建镜像
|
| 146 |
|
| 147 |
```
|
| 148 |
docker build -t chuanhuchatgpt:latest .
|
| 149 |
```
|
| 150 |
|
| 151 |
+
</p>
|
| 152 |
+
</details>
|
| 153 |
+
|
| 154 |
|
| 155 |
## 部署相关
|
| 156 |
|
| 157 |
+
<details>
|
| 158 |
+
<p>
|
| 159 |
+
|
| 160 |
### 部署到公网服务器
|
| 161 |
|
| 162 |
将最后一句修改为
|
|
|
|
| 212 |
}
|
| 213 |
```
|
| 214 |
|
| 215 |
+
</p>
|
| 216 |
+
</details>
|
| 217 |
+
|
| 218 |
## 疑难杂症解决
|
| 219 |
|
| 220 |
|
| 221 |
### No module named '_bz2'
|
| 222 |
|
| 223 |
+
<details>
|
| 224 |
+
<p>
|
| 225 |
+
|
| 226 |
太空急先锋:部署在CentOS7.6,Python3.11.0上,最后报错ModuleNotFoundError: No module named '_bz2'
|
| 227 |
|
| 228 |
解决方案:安装python前得下个bzip编译环境
|
|
|
|
| 254 |
参考自:
|
| 255 |
[解决OpenAI API 挂了代理还是连接不上的问题](https://zhuanlan.zhihu.com/p/611080662)
|
| 256 |
|
| 257 |
+
</p>
|
| 258 |
+
</details>
|
|
|
|
|
|
|
|
|
|
| 259 |
|
| 260 |
### 在 Python 文件里 设定 API Key 之后验证失败
|
| 261 |
|
|
|
|
| 263 |
|
| 264 |
### 重装 gradio
|
| 265 |
|
| 266 |
+
<details>
|
| 267 |
+
<p>
|
| 268 |
+
|
| 269 |
很多时候,这样就可以解决问题。
|
| 270 |
|
| 271 |
```
|
| 272 |
pip install gradio --upgrade --force-reinstall
|
| 273 |
```
|
| 274 |
|
| 275 |
+
</p>
|
| 276 |
+
</details>
|
| 277 |
+
|
| 278 |
### 一直等待/SSL Error [#49](https://github.com/GaiZhenbiao/ChuanhuChatGPT/issues/49)
|
| 279 |
|
| 280 |
+
<details>
|
| 281 |
+
<p>
|
| 282 |
+
|
| 283 |
+
跑起来之后,输入问题好像就没反应了,也没报错 [#25](https://github.com/GaiZhenbiao/ChuanhuChatGPT/issues/25)
|
| 284 |
+
|
| 285 |
```
|
| 286 |
requests.exceptions.SSLError: HTTPSConnectionPool(host='api.openai.com', port=443): Max retries exceeded with url: /v1/chat/completions (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1129)')))
|
| 287 |
```
|
|
|
|
| 304 |
DOMAIN-SUFFIX,openai.com,你的代理规则
|
| 305 |
```
|
| 306 |
|
| 307 |
+
</p>
|
| 308 |
+
</details>
|
| 309 |
+
|
| 310 |
+
### 网页提示错误 Something went wrong
|
| 311 |
+
|
| 312 |
+
<details>
|
| 313 |
+
<p>
|
| 314 |
|
| 315 |
```
|
| 316 |
Something went wrong
|
|
|
|
| 319 |
|
| 320 |
出现这个错误的原因是`127.0.0.1`被代理了,导致网页无法和后端通信。请设置代理软件,将`127.0.0.1`加入直连。
|
| 321 |
|
| 322 |
+
</p>
|
| 323 |
+
</details>
|
| 324 |
+
|
| 325 |
### No matching distribution found for openai>=0.27.0
|
| 326 |
|
| 327 |
`openai`这个依赖已经被移除了。请尝试下载最新版脚本。
|
|
|
|
| 335 |
<a href="https://github.com/GaiZhenbiao/ChuanhuChatGPT/graphs/contributors">
|
| 336 |
<img src="https://contrib.rocks/image?repo=GaiZhenbiao/ChuanhuChatGPT" />
|
| 337 |
</a>
|
| 338 |
+
|
| 339 |
+
## 捐款
|
| 340 |
+
|
| 341 |
+
请作者喝可乐~
|
| 342 |
+
|
| 343 |
+
<img width="350" alt="image" src="https://user-images.githubusercontent.com/51039745/223626874-f471e5f5-8a06-43d5-aa31-9d2575b6f631.JPG">
|
| 344 |
+
|