From f3f90f7b90979d56489d65297342b401b15ec31e Mon Sep 17 00:00:00 2001
From: binary-husky <96192199+binary-husky@users.noreply.github.com>
Date: Mon, 30 Oct 2023 01:10:45 +0800
Subject: [PATCH 1/6] Update README.md
---
README.md | 81 +++++++++++++++++++------------------------------------
1 file changed, 28 insertions(+), 53 deletions(-)
diff --git a/README.md b/README.md
index c93b57a1..83f385c9 100644
--- a/README.md
+++ b/README.md
@@ -7,18 +7,18 @@
#

GPT 学术优化 (GPT Academic)
-**如果喜欢这个项目,请给它一个Star;如果您发明了好用的快捷键或函数插件,欢迎发pull requests!**
+**如果喜欢这个项目,请给它一个Star;如果您发明了好用的快捷键或插件,欢迎发pull requests!**
-If you like this project, please give it a Star. If you've come up with more useful academic shortcuts or functional plugins, feel free to open an issue or pull request. We also have a README in [English|](docs/README_EN.md)[日本語|](docs/README_JP.md)[한국어|](https://github.com/mldljyh/ko_gpt_academic)[Русский|](docs/README_RS.md)[Français](docs/README_FR.md) translated by this project itself.
+If you like this project, please give it a Star. We also have a README in [English|](docs/README_EN.md)[日本語|](docs/README_JP.md)[한국어|](https://github.com/mldljyh/ko_gpt_academic)[Русский|](docs/README_RS.md)[Français](docs/README_FR.md) translated by this project itself.
To translate this project to arbitrary language with GPT, read and run [`multi_language.py`](multi_language.py) (experimental).
> **Note**
>
-> 1.请注意只有 **高亮** 标识的函数插件(按钮)才支持读取文件,部分插件位于插件区的**下拉菜单**中。另外我们以**最高优先级**欢迎和处理任何新插件的PR。
+> 1.请注意只有 **高亮** 标识的插件(按钮)才支持读取文件,部分插件位于插件区的**下拉菜单**中。另外我们以**最高优先级**欢迎和处理任何新插件的PR。
>
-> 2.本项目中每个文件的功能都在[自译解报告`self_analysis.md`](https://github.com/binary-husky/gpt_academic/wiki/GPT‐Academic项目自译解报告)详细说明。随着版本的迭代,您也可以随时自行点击相关函数插件,调用GPT重新生成项目的自我解析报告。常见问题[`wiki`](https://github.com/binary-husky/gpt_academic/wiki)。[常规安装方法](#installation) | [一键安装脚本](https://github.com/binary-husky/gpt_academic/releases) | [配置说明](https://github.com/binary-husky/gpt_academic/wiki/%E9%A1%B9%E7%9B%AE%E9%85%8D%E7%BD%AE%E8%AF%B4%E6%98%8E)。
+> 2.本项目中每个文件的功能都在[自译解报告`self_analysis.md`](https://github.com/binary-husky/gpt_academic/wiki/GPT‐Academic项目自译解报告)详细说明。随着版本的迭代,您也可以随时自行点击相关函数插件,调用GPT重新生成项目的自我解析报告。常见问题[`wiki`](https://github.com/binary-husky/gpt_academic/wiki)。[常规安装方法](#installation) | [一键安装脚本](https://github.com/binary-husky/gpt_academic/releases) | [配置说明](https://github.com/binary-husky/gpt_academic/wiki/项目配置说明)。
>
-> 3.本项目兼容并鼓励尝试国产大语言模型ChatGLM和Moss等等。支持多个api-key共存,可在配置文件中填写如`API_KEY="openai-key1,openai-key2,azure-key3,api2d-key4"`。需要临时更换`API_KEY`时,在输入区输入临时的`API_KEY`然后回车键提交后即可生效。
+> 3.本项目兼容并鼓励尝试国产大语言模型ChatGLM等。支持多个api-key共存,可在配置文件中填写如`API_KEY="openai-key1,openai-key2,azure-key3,api2d-key4"`。需要临时更换`API_KEY`时,在输入区输入临时的`API_KEY`然后回车键提交后即可生效。
@@ -101,16 +101,16 @@ cd gpt_academic
2. 配置API_KEY
-在`config.py`中,配置API KEY等设置,[点击查看特殊网络环境设置方法](https://github.com/binary-husky/gpt_academic/issues/1) 。[Wiki页面](https://github.com/binary-husky/gpt_academic/wiki/%E9%A1%B9%E7%9B%AE%E9%85%8D%E7%BD%AE%E8%AF%B4%E6%98%8E)。
+在`config.py`中,配置API KEY等设置,[点击查看特殊网络环境设置方法](https://github.com/binary-husky/gpt_academic/issues/1) 。[Wiki页面](https://github.com/binary-husky/gpt_academic/wiki/项目配置说明)。
「 程序会优先检查是否存在名为`config_private.py`的私密配置文件,并用其中的配置覆盖`config.py`的同名配置。如您能理解该读取逻辑,我们强烈建议您在`config.py`旁边创建一个名为`config_private.py`的新配置文件,并把`config.py`中的配置转移(复制)到`config_private.py`中(仅复制您修改过的配置条目即可)。 」
-「 支持通过`环境变量`配置项目,环境变量的书写格式参考`docker-compose.yml`文件或者我们的[Wiki页面](https://github.com/binary-husky/gpt_academic/wiki/%E9%A1%B9%E7%9B%AE%E9%85%8D%E7%BD%AE%E8%AF%B4%E6%98%8E)。配置读取优先级: `环境变量` > `config_private.py` > `config.py`。 」
+「 支持通过`环境变量`配置项目,环境变量的书写格式参考`docker-compose.yml`文件或者我们的[Wiki页面](https://github.com/binary-husky/gpt_academic/wiki/项目配置说明)。配置读取优先级: `环境变量` > `config_private.py` > `config.py`。 」
3. 安装依赖
```sh
-# (选择I: 如熟悉python)(python版本3.9以上,越新越好),备注:使用官方pip源或者阿里pip源,临时换源方法:python -m pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/
+# (选择I: 如熟悉python, python>=3.9)备注:使用官方pip源或者阿里pip源, 临时换源方法:python -m pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/
python -m pip install -r requirements.txt
# (选择II: 使用Anaconda)步骤也是类似的 (https://www.bilibili.com/video/BV1rc411W7Dr):
@@ -151,11 +151,11 @@ python main.py
### 安装方法II:使用Docker
-0. 部署项目的全部能力(这个是包含cuda和latex的大型镜像。如果您网速慢、硬盘小或没有显卡,则不推荐使用这个,建议使用方案1)(需要熟悉[Nvidia Docker](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html#installing-on-ubuntu-and-debian)运行时)
-[](https://github.com/binary-husky/gpt_academic/actions/workflows/build-with-audio-assistant.yml)
+0. 部署项目的全部能力(这个是包含cuda和latex的大型镜像。但如果您网速慢、硬盘小,则不推荐使用这个)
+[](https://github.com/binary-husky/gpt_academic/actions/workflows/build-with-all-capacity.yml)
``` sh
-# 修改docker-compose.yml,保留方案0并删除其他方案。修改docker-compose.yml中方案0的配置,参考其中注释即可
+# 修改docker-compose.yml,保留方案0并删除其他方案。然后运行:
docker-compose up
```
@@ -165,7 +165,7 @@ docker-compose up
[](https://github.com/binary-husky/gpt_academic/actions/workflows/build-with-audio-assistant.yml)
``` sh
-# 修改docker-compose.yml,保留方案1并删除其他方案。修改docker-compose.yml中方案1的配置,参考其中注释即可
+# 修改docker-compose.yml,保留方案1并删除其他方案。然后运行:
docker-compose up
```
@@ -175,48 +175,30 @@ P.S. 如果需要依赖Latex的插件功能,请见Wiki。另外,您也可以
[](https://github.com/binary-husky/gpt_academic/actions/workflows/build-with-chatglm.yml)
``` sh
-# 修改docker-compose.yml,保留方案2并删除其他方案。修改docker-compose.yml中方案2的配置,参考其中注释即可
-docker-compose up
-```
-
-3. ChatGPT + LLAMA + 盘古 + RWKV(需要熟悉[Nvidia Docker](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html#installing-on-ubuntu-and-debian)运行时)
-[](https://github.com/binary-husky/gpt_academic/actions/workflows/build-with-jittorllms.yml)
-
-``` sh
-# 修改docker-compose.yml,保留方案3并删除其他方案。修改docker-compose.yml中方案3的配置,参考其中注释即可
+# 修改docker-compose.yml,保留方案2并删除其他方案。然后运行:
docker-compose up
```
### 安装方法III:其他部署姿势
-1. 一键运行脚本。
+1. **Windows一键运行脚本**。
完全不熟悉python环境的Windows用户可以下载[Release](https://github.com/binary-husky/gpt_academic/releases)中发布的一键运行脚本安装无本地模型的版本。
脚本的贡献来源是[oobabooga](https://github.com/oobabooga/one-click-installers)。
-2. 使用docker-compose运行。
-请阅读docker-compose.yml后,按照其中的提示操作即可
+2. 使用第三方API、Azure等、文心一言、星火等,见[Wiki页面](https://github.com/binary-husky/gpt_academic/wiki/项目配置说明)
-3. 如何使用反代URL
-按照`config.py`中的说明配置API_URL_REDIRECT即可。
+3. 云服务器远程部署避坑指南。
+请访问[云服务器远程部署wiki](https://github.com/binary-husky/gpt_academic/wiki/%E4%BA%91%E6%9C%8D%E5%8A%A1%E5%99%A8%E8%BF%9C%E7%A8%8B%E9%83%A8%E7%BD%B2%E6%8C%87%E5%8D%97)
-4. 微软云AzureAPI
-按照`config.py`中的说明配置即可(AZURE_ENDPOINT等四个配置)
-
-5. 远程云服务器部署(需要云服务器知识与经验)。
-请访问[部署wiki-1](https://github.com/binary-husky/gpt_academic/wiki/%E4%BA%91%E6%9C%8D%E5%8A%A1%E5%99%A8%E8%BF%9C%E7%A8%8B%E9%83%A8%E7%BD%B2%E6%8C%87%E5%8D%97)
-
-6. 使用Sealos[一键部署](https://github.com/binary-husky/gpt_academic/issues/993)。
-
-7. 使用WSL2(Windows Subsystem for Linux 子系统)。
-请访问[部署wiki-2](https://github.com/binary-husky/gpt_academic/wiki/%E4%BD%BF%E7%94%A8WSL2%EF%BC%88Windows-Subsystem-for-Linux-%E5%AD%90%E7%B3%BB%E7%BB%9F%EF%BC%89%E9%83%A8%E7%BD%B2)
-
-8. 如何在二级网址(如`http://localhost/subpath`)下运行。
-请访问[FastAPI运行说明](docs/WithFastapi.md)
+4. 一些新型的部署平台或方法
+ - 使用Sealos[一键部署](https://github.com/binary-husky/gpt_academic/issues/993)。
+ - 使用WSL2(Windows Subsystem for Linux 子系统)。请访问[部署wiki-2](https://github.com/binary-husky/gpt_academic/wiki/%E4%BD%BF%E7%94%A8WSL2%EF%BC%88Windows-Subsystem-for-Linux-%E5%AD%90%E7%B3%BB%E7%BB%9F%EF%BC%89%E9%83%A8%E7%BD%B2)
+ - 如何在二级网址(如`http://localhost/subpath`)下运行。请访问[FastAPI运行说明](docs/WithFastapi.md)
# Advanced Usage
### I:自定义新的便捷按钮(学术快捷键)
-任意文本编辑器打开`core_functional.py`,添加条目如下,然后重启程序即可。(如果按钮已经添加成功并可见,那么前缀、后缀都支持热修改,无需重启程序即可生效。)
+任意文本编辑器打开`core_functional.py`,添加条目如下,然后重启程序。(如按钮已存在,那么前缀、后缀都支持热修改,无需重启程序即可生效。)
例如
```
"超级英译中": {
@@ -232,14 +214,13 @@ docker-compose up
### II:自定义函数插件
-
编写强大的函数插件来执行任何你想得到的和想不到的任务。
本项目的插件编写、调试难度很低,只要您具备一定的python基础知识,就可以仿照我们提供的模板实现自己的插件功能。
详情请参考[函数插件指南](https://github.com/binary-husky/gpt_academic/wiki/%E5%87%BD%E6%95%B0%E6%8F%92%E4%BB%B6%E6%8C%87%E5%8D%97)。
-# Latest Update
-### I:新功能动态
+# Updates
+### I:动态
1. 对话保存功能。在函数插件区调用 `保存当前的对话` 即可将当前对话保存为可读+可复原的html文件,
另外在函数插件区(下拉菜单)调用 `载入对话历史存档` ,即可还原之前的会话。
@@ -280,28 +261,23 @@ Tip:不指定文件直接点击 `载入对话历史存档` 可以查看历史h
-7. 新增MOSS大语言模型支持
-
-

-
-
-8. OpenAI图像生成
+7. OpenAI图像生成
-9. OpenAI音频解析与总结
+8. OpenAI音频解析与总结
-10. Latex全文校对纠错
+9. Latex全文校对纠错

===>
-11. 语言、主题切换
+10. 语言、主题切换
@@ -348,7 +324,6 @@ GPT Academic开发者QQ群:`610599535`
### IV:本项目的开发分支
1. `master` 分支: 主分支,稳定版
-
2. `frontier` 分支: 开发分支,测试版
From 9fb29f249bd146e70343d51c29795eff895896bb Mon Sep 17 00:00:00 2001
From: Zorn Wang
Date: Mon, 30 Oct 2023 19:20:05 +0800
Subject: [PATCH 2/6] =?UTF-8?q?Feature:=20=E6=B7=BB=E5=8A=A0=E7=99=BE?=
=?UTF-8?q?=E5=BA=A6=E5=8D=83=E5=B8=86=E6=96=87=E5=BF=834.0=E5=A4=A7?=
=?UTF-8?q?=E6=A8=A1=E5=9E=8B=E6=94=AF=E6=8C=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
config.py | 2 +-
request_llm/bridge_qianfan.py | 5 +++--
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/config.py b/config.py
index abea7ea3..b4f00a63 100644
--- a/config.py
+++ b/config.py
@@ -98,7 +98,7 @@ AVAIL_LLM_MODELS = ["gpt-3.5-turbo-16k", "gpt-3.5-turbo", "azure-gpt-3.5",
# 百度千帆(LLM_MODEL="qianfan")
BAIDU_CLOUD_API_KEY = ''
BAIDU_CLOUD_SECRET_KEY = ''
-BAIDU_CLOUD_QIANFAN_MODEL = 'ERNIE-Bot' # 可选 "ERNIE-Bot"(文心一言), "ERNIE-Bot-turbo", "BLOOMZ-7B", "Llama-2-70B-Chat", "Llama-2-13B-Chat", "Llama-2-7B-Chat"
+BAIDU_CLOUD_QIANFAN_MODEL = 'ERNIE-Bot' # 可选 "ERNIE-Bot-4"(文心大模型4.0), "ERNIE-Bot"(文心一言), "ERNIE-Bot-turbo", "BLOOMZ-7B", "Llama-2-70B-Chat", "Llama-2-13B-Chat", "Llama-2-7B-Chat"
# 如果使用ChatGLM2微调模型,请把 LLM_MODEL="chatglmft",并在此处指定模型路径
diff --git a/request_llm/bridge_qianfan.py b/request_llm/bridge_qianfan.py
index be739760..bbae5630 100644
--- a/request_llm/bridge_qianfan.py
+++ b/request_llm/bridge_qianfan.py
@@ -78,8 +78,9 @@ def generate_from_baidu_qianfan(inputs, llm_kwargs, history, system_prompt):
BAIDU_CLOUD_QIANFAN_MODEL, = get_conf('BAIDU_CLOUD_QIANFAN_MODEL')
url_lib = {
- "ERNIE-Bot": "https://aip.baidubce.com/rpc/2.0/ai_custom/v1/wenxinworkshop/chat/completions" ,
- "ERNIE-Bot-turbo": "https://aip.baidubce.com/rpc/2.0/ai_custom/v1/wenxinworkshop/chat/eb-instant" ,
+ "ERNIE-Bot-4": "https://aip.baidubce.com/rpc/2.0/ai_custom/v1/wenxinworkshop/chat/completions_pro",
+ "ERNIE-Bot": "https://aip.baidubce.com/rpc/2.0/ai_custom/v1/wenxinworkshop/chat/completions",
+ "ERNIE-Bot-turbo": "https://aip.baidubce.com/rpc/2.0/ai_custom/v1/wenxinworkshop/chat/eb-instant",
"BLOOMZ-7B": "https://aip.baidubce.com/rpc/2.0/ai_custom/v1/wenxinworkshop/chat/bloomz_7b1",
"Llama-2-70B-Chat": "https://aip.baidubce.com/rpc/2.0/ai_custom/v1/wenxinworkshop/chat/llama_2_70b",
From ca7ff47fcb3105ba3134196161c3f557be693cf2 Mon Sep 17 00:00:00 2001
From: ji-jinlong <61379293+ji-jinlong@users.noreply.github.com>
Date: Wed, 1 Nov 2023 16:05:57 +0800
Subject: [PATCH 3/6] =?UTF-8?q?Update=20=E7=90=86=E8=A7=A3PDF=E6=96=87?=
=?UTF-8?q?=E6=A1=A3=E5=86=85=E5=AE=B9.py?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
crazy_functions/理解PDF文档内容.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/crazy_functions/理解PDF文档内容.py b/crazy_functions/理解PDF文档内容.py
index f1a89a7e..4674b935 100644
--- a/crazy_functions/理解PDF文档内容.py
+++ b/crazy_functions/理解PDF文档内容.py
@@ -49,7 +49,7 @@ def 解析PDF(file_name, llm_kwargs, plugin_kwargs, chatbot, history, system_pro
gpt_say = yield from request_gpt_model_in_new_thread_with_ui_alive(i_say, i_say_show_user, # i_say=真正给chatgpt的提问, i_say_show_user=给用户看的提问
llm_kwargs, chatbot,
history=["The main idea of the previous section is?", last_iteration_result], # 迭代上一次的结果
- sys_prompt="Extract the main idea of this section." # 提示
+ sys_prompt="Extract the main idea of this section.用中文回答我" # 提示
)
iteration_results.append(gpt_say)
last_iteration_result = gpt_say
From cd9f2ec402f952b0a112f1f71c19f00c90697648 Mon Sep 17 00:00:00 2001
From: binary-husky <96192199+binary-husky@users.noreply.github.com>
Date: Wed, 1 Nov 2023 22:25:27 +0800
Subject: [PATCH 4/6] Update README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 83f385c9..60e7be15 100644
--- a/README.md
+++ b/README.md
@@ -61,7 +61,7 @@ Latex论文一键校对 | [函数插件] 仿Grammarly对Latex文章进行语法
- 新界面(修改`config.py`中的LAYOUT选项即可实现“左右布局”和“上下布局”的切换)
-

+
From f016323b8aafe2c4c3d4dd4561fdfc8d7cbf234d Mon Sep 17 00:00:00 2001
From: binary-husky <96192199+binary-husky@users.noreply.github.com>
Date: Wed, 1 Nov 2023 22:26:46 +0800
Subject: [PATCH 5/6] =?UTF-8?q?Update=20=E7=90=86=E8=A7=A3PDF=E6=96=87?=
=?UTF-8?q?=E6=A1=A3=E5=86=85=E5=AE=B9.py?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
crazy_functions/理解PDF文档内容.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/crazy_functions/理解PDF文档内容.py b/crazy_functions/理解PDF文档内容.py
index 4674b935..3b2db998 100644
--- a/crazy_functions/理解PDF文档内容.py
+++ b/crazy_functions/理解PDF文档内容.py
@@ -49,7 +49,7 @@ def 解析PDF(file_name, llm_kwargs, plugin_kwargs, chatbot, history, system_pro
gpt_say = yield from request_gpt_model_in_new_thread_with_ui_alive(i_say, i_say_show_user, # i_say=真正给chatgpt的提问, i_say_show_user=给用户看的提问
llm_kwargs, chatbot,
history=["The main idea of the previous section is?", last_iteration_result], # 迭代上一次的结果
- sys_prompt="Extract the main idea of this section.用中文回答我" # 提示
+ sys_prompt="Extract the main idea of this section, answer me with Chinese." # 提示
)
iteration_results.append(gpt_say)
last_iteration_result = gpt_say
From 245585be81b3670207f4ada9d35c0c898ea37c34 Mon Sep 17 00:00:00 2001
From: binary-husky <96192199+binary-husky@users.noreply.github.com>
Date: Tue, 7 Nov 2023 10:39:35 +0800
Subject: [PATCH 6/6] Update README.md
---
README.md | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index 60e7be15..0378eaa1 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,11 @@
> **Note**
->
+>
> 2023.10.28: 紧急修复了若干问题,安装依赖时,请选择`requirements.txt`中**指定的版本**。
->
+>
> `pip install -r requirements.txt`
+>
+> 2023.11.7: 本项目开源免费,**近期发现有人蔑视开源协议,利用本项目违法圈钱**,请各位提高警惕,谨防上当受骗。
+
# 
GPT 学术优化 (GPT Academic)