From dd92fa235ec29073da187f4966e8daf28aa947c7 Mon Sep 17 00:00:00 2001 From: binary-husky <96192199+binary-husky@users.noreply.github.com> Date: Mon, 17 Apr 2023 23:37:10 +0800 Subject: [PATCH 01/10] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e0d6fd8..dcba8d8 100644 --- a/README.md +++ b/README.md @@ -68,9 +68,9 @@ huggingface免科学上网[在线体验](https://huggingface.co/spaces/qingxu98/ -- 多种大语言模型混合调用([v3.1分支](https://github.com/binary-husky/chatgpt_academic/tree/v3.1)测试中) +- 多种大语言模型混合调用(ChatGLM + OpenAI-GPT3.5 + API2D-GPT4 [v3.1分支](https://github.com/binary-husky/chatgpt_academic/tree/v3.1)测试中)
- +
From 48e7757a1906c20bffc7b44823fde04bd7c8f430 Mon Sep 17 00:00:00 2001 From: binary-husky <96192199+binary-husky@users.noreply.github.com> Date: Mon, 17 Apr 2023 23:38:27 +0800 Subject: [PATCH 02/10] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index dcba8d8..9395f89 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ huggingface免科学上网[在线体验](https://huggingface.co/spaces/qingxu98/ -- 多种大语言模型混合调用(ChatGLM + OpenAI-GPT3.5 + API2D-GPT4 [v3.1分支](https://github.com/binary-husky/chatgpt_academic/tree/v3.1)测试中) +- 多种大语言模型混合调用(ChatGLM + OpenAI-GPT3.5 + [API2D-GPT4](https://api2d.com/) [v3.1分支](https://github.com/binary-husky/chatgpt_academic/tree/v3.1)测试中)
From 1d449f555678d2472e2d661477eac942ac57d6b4 Mon Sep 17 00:00:00 2001 From: binary-husky <96192199+binary-husky@users.noreply.github.com> Date: Mon, 17 Apr 2023 23:38:53 +0800 Subject: [PATCH 03/10] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9395f89..a5f8618 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ huggingface免科学上网[在线体验](https://huggingface.co/spaces/qingxu98/ -- 多种大语言模型混合调用(ChatGLM + OpenAI-GPT3.5 + [API2D-GPT4](https://api2d.com/) [v3.1分支](https://github.com/binary-husky/chatgpt_academic/tree/v3.1)测试中) +- 多种大语言模型混合调用(ChatGLM + OpenAI-GPT3.5 + [API2D](https://api2d.com/)-GPT4 [v3.1分支](https://github.com/binary-husky/chatgpt_academic/tree/v3.1)测试中)
From a8f0801e9915df368fb06fe104f259855f4f9086 Mon Sep 17 00:00:00 2001 From: binary-husky <96192199+binary-husky@users.noreply.github.com> Date: Mon, 17 Apr 2023 23:39:36 +0800 Subject: [PATCH 04/10] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a5f8618..6e595d9 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ huggingface免科学上网[在线体验](https://huggingface.co/spaces/qingxu98/ -- 多种大语言模型混合调用(ChatGLM + OpenAI-GPT3.5 + [API2D](https://api2d.com/)-GPT4 [v3.1分支](https://github.com/binary-husky/chatgpt_academic/tree/v3.1)测试中) +- 多种大语言模型混合调用(ChatGLM + OpenAI-GPT3.5 + [API2D](https://api2d.com/)-GPT4, [v3.1分支](https://github.com/binary-husky/chatgpt_academic/tree/v3.1)测试中)
From aebd48bc84a79f33f6543f046597cc5aff664f4d Mon Sep 17 00:00:00 2001 From: binary-husky <96192199+binary-husky@users.noreply.github.com> Date: Tue, 18 Apr 2023 00:12:22 +0800 Subject: [PATCH 05/10] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 6e595d9..96b0435 100644 --- a/README.md +++ b/README.md @@ -73,6 +73,8 @@ huggingface免科学上网[在线体验](https://huggingface.co/spaces/qingxu98/ +v3.1的[huggingface测试版](https://huggingface.co/spaces/qingxu98/academic-chatgpt-beta)(huggingface版不支持chatglm) + ## 直接运行 (Windows, Linux or MacOS) From 4c486f27c8d801a25fcfd15c7ec02eada50bb335 Mon Sep 17 00:00:00 2001 From: binary-husky <96192199+binary-husky@users.noreply.github.com> Date: Tue, 18 Apr 2023 15:47:48 +0800 Subject: [PATCH 06/10] Update toolbox.py --- toolbox.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolbox.py b/toolbox.py index 3ced653..5bbe954 100644 --- a/toolbox.py +++ b/toolbox.py @@ -455,7 +455,7 @@ def on_file_uploaded(files, chatbot, txt): chatbot.append(['我上传了文件,请查收', f'[Local Message] 收到以下文件: \n\n{moved_files_str}' + f'\n\n调用路径参数已自动修正到: \n\n{txt}' + - f'\n\n现在您点击任意实验功能时,以上文件将被作为输入参数'+err_msg]) + f'\n\n现在您点击任意“红颜色”标识的函数插件时,以上文件将被作为输入参数'+err_msg]) return chatbot, txt From d35d7710c1bae82f252c570924ce8751ab154cc3 Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 18 Apr 2023 16:14:30 +0800 Subject: [PATCH 07/10] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dpdf=E5=88=86=E8=A7=A3bu?= =?UTF-8?q?g?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crazy_functions/crazy_utils.py | 1 + 1 file changed, 1 insertion(+) diff --git a/crazy_functions/crazy_utils.py b/crazy_functions/crazy_utils.py index 189d948..356650d 100644 --- a/crazy_functions/crazy_utils.py +++ b/crazy_functions/crazy_utils.py @@ -444,6 +444,7 @@ def read_and_clean_pdf_text(fp): pf = 998 for l in t['lines']: txt_line = "".join([wtf['text'] for wtf in l['spans']]) + if len(txt_line) == 0: continue pf = primary_ffsize(l) meta_line.append([txt_line, pf, l['bbox'], l]) for wtf in l['spans']: # for l in t['lines']: From adb49f38661e525af505acedc630ef5fceab5fd6 Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 18 Apr 2023 16:15:59 +0800 Subject: [PATCH 08/10] =?UTF-8?q?=E9=94=99=E5=88=AB=E5=AD=97?= 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 79c1253..d6329db 100644 --- a/crazy_functions/批量翻译PDF文档_多线程.py +++ b/crazy_functions/批量翻译PDF文档_多线程.py @@ -13,7 +13,7 @@ def 批量翻译PDF文档(txt, llm_kwargs, plugin_kwargs, chatbot, history, sys_ # 基本信息:功能、贡献者 chatbot.append([ "函数插件功能?", - "批量总结PDF文档。函数插件贡献者: Binary-Husky"]) + "批量翻译PDF文档。函数插件贡献者: Binary-Husky"]) yield from update_ui(chatbot=chatbot, history=history) # 刷新界面 # 尝试导入依赖,如果缺少依赖,则给出安装建议 From 095385f889fe78aa80f7ec3c9e8ffdc541891454 Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 18 Apr 2023 17:22:46 +0800 Subject: [PATCH 09/10] =?UTF-8?q?=E5=BC=BA=E8=B0=83=E5=AE=8C=E6=95=B4?= =?UTF-8?q?=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crazy_functions/批量翻译PDF文档_多线程.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crazy_functions/批量翻译PDF文档_多线程.py b/crazy_functions/批量翻译PDF文档_多线程.py index d6329db..42e75b4 100644 --- a/crazy_functions/批量翻译PDF文档_多线程.py +++ b/crazy_functions/批量翻译PDF文档_多线程.py @@ -59,7 +59,7 @@ def 批量翻译PDF文档(txt, llm_kwargs, plugin_kwargs, chatbot, history, sys_ def 解析PDF(file_manifest, project_folder, llm_kwargs, plugin_kwargs, chatbot, history, sys_prompt): import os import tiktoken - TOKEN_LIMIT_PER_FRAGMENT = 1600 + TOKEN_LIMIT_PER_FRAGMENT = 1280 generated_conclusion_files = [] for index, fp in enumerate(file_manifest): @@ -91,13 +91,13 @@ def 解析PDF(file_manifest, project_folder, llm_kwargs, plugin_kwargs, chatbot, # 多线,翻译 gpt_response_collection = yield from request_gpt_model_multi_threads_with_very_awesome_ui_and_high_efficiency( inputs_array=[ - f"以下是你需要翻译的论文片段:\n{frag}" for frag in paper_fragments], + f"你需要翻译以下内容:\n{frag}" for frag in paper_fragments], inputs_show_user_array=[f"\n---\n 原文: \n\n {frag.replace('#', '')} \n---\n 翻译:\n " for frag in paper_fragments], llm_kwargs=llm_kwargs, chatbot=chatbot, history_array=[[paper_meta] for _ in paper_fragments], sys_prompt_array=[ - "请你作为一个学术翻译,负责把学术论文的片段准确翻译成中文。" for _ in paper_fragments], + "请你作为一个学术翻译,负责把学术论文准确翻译成中文。注意文章中的每一句话都要翻译。" for _ in paper_fragments], # max_workers=5 # OpenAI所允许的最大并行过载 ) From 0a5464d7d6ae87808992c710c7177927cf9ffed3 Mon Sep 17 00:00:00 2001 From: binary-husky <96192199+binary-husky@users.noreply.github.com> Date: Tue, 18 Apr 2023 23:24:15 +0800 Subject: [PATCH 10/10] Update crazy_utils.py --- crazy_functions/crazy_utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crazy_functions/crazy_utils.py b/crazy_functions/crazy_utils.py index 356650d..ba5f18c 100644 --- a/crazy_functions/crazy_utils.py +++ b/crazy_functions/crazy_utils.py @@ -555,8 +555,8 @@ def read_and_clean_pdf_text(fp): meta_txt = meta_txt.replace('\n', '\n\n') ############################## <第 5 步,展示分割效果> ################################## - for f in finals: - print亮黄(f) - print亮绿('***************************') + # for f in finals: + # print亮黄(f) + # print亮绿('***************************') return meta_txt, page_one_meta