From a593e2e4acba3d303b4c41bded664778919de2ca Mon Sep 17 00:00:00 2001 From: binary-husky <96192199+binary-husky@users.noreply.github.com> Date: Sat, 15 Apr 2023 19:11:00 +0800 Subject: [PATCH 1/2] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 86c388c..e0d6fd8 100644 --- a/README.md +++ b/README.md @@ -34,8 +34,8 @@ chat分析报告生成 | [函数插件] 运行后自动生成总结汇报 公式/图片/表格显示 | 可以同时显示公式的tex形式和渲染形式,支持公式、代码高亮 多线程函数插件支持 | 支持多线调用chatgpt,一键处理海量文本或程序 启动暗色gradio[主题](https://github.com/binary-husky/chatgpt_academic/issues/173) | 在浏览器url后面添加```/?__dark-theme=true```可以切换dark主题 -[多LLM模型](https://www.bilibili.com/video/BV1EM411K7VH/)支持([v3.0分支](https://github.com/binary-husky/chatgpt_academic/tree/v3.0)) | 同时被ChatGPT和[清华ChatGLM](https://github.com/THUDM/ChatGLM-6B)伺候的感觉一定会很不错吧? -兼容[TGUI](https://github.com/oobabooga/text-generation-webui)接入更多样的语言模型 | 接入opt-1.3b, galactica-1.3b等模型([v3.0分支](https://github.com/binary-husky/chatgpt_academic/tree/v3.0)测试中) +[多LLM模型](https://www.bilibili.com/video/BV1EM411K7VH/)支持([v3.1分支](https://github.com/binary-husky/chatgpt_academic/tree/v3.1)) | 同时被ChatGPT和[清华ChatGLM](https://github.com/THUDM/ChatGLM-6B)伺候的感觉一定会很不错吧? +兼容[TGUI](https://github.com/oobabooga/text-generation-webui)接入更多样的语言模型 | 接入opt-1.3b, galactica-1.3b等模型([v3.1分支](https://github.com/binary-husky/chatgpt_academic/tree/v3.0)测试中) huggingface免科学上网[在线体验](https://huggingface.co/spaces/qingxu98/gpt-academic) | 登陆huggingface后复制[此空间](https://huggingface.co/spaces/qingxu98/gpt-academic) …… | …… @@ -68,7 +68,7 @@ huggingface免科学上网[在线体验](https://huggingface.co/spaces/qingxu98/ -- 多种大语言模型混合调用([v3.0分支](https://github.com/binary-husky/chatgpt_academic/tree/v3.0)测试中) +- 多种大语言模型混合调用([v3.1分支](https://github.com/binary-husky/chatgpt_academic/tree/v3.1)测试中)
From 321a51b5f9139a1039760e6f2a0b0f1d58eee195 Mon Sep 17 00:00:00 2001 From: wenx29 Date: Sat, 15 Apr 2023 17:05:19 -0400 Subject: [PATCH 2/2] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=A7=A3=E6=9E=90C#?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crazy_functional.py | 6 ++++++ crazy_functions/解析项目源代码.py | 20 ++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/crazy_functional.py b/crazy_functional.py index f701167..af308b7 100644 --- a/crazy_functional.py +++ b/crazy_functional.py @@ -17,6 +17,7 @@ def get_crazy_functions(): from crazy_functions.代码重写为全英文_多线程 import 全项目切换英文 from crazy_functions.Latex全文润色 import Latex英文润色 from crazy_functions.解析项目源代码 import 解析一个Lua项目 + from crazy_functions.解析项目源代码 import 解析一个CSharp项目 function_plugins = { "解析整个Python项目": { @@ -52,6 +53,11 @@ def get_crazy_functions(): "AsButton": False, # 加入下拉菜单中 "Function": HotReload(解析一个Lua项目) }, + "解析整个CSharp项目": { + "Color": "stop", # 按钮颜色 + "AsButton": False, # 加入下拉菜单中 + "Function": HotReload(解析一个CSharp项目) + }, "读Tex论文写摘要": { "Color": "stop", # 按钮颜色 "Function": HotReload(读文章写摘要) diff --git a/crazy_functions/解析项目源代码.py b/crazy_functions/解析项目源代码.py index 3af7497..04e5128 100644 --- a/crazy_functions/解析项目源代码.py +++ b/crazy_functions/解析项目源代码.py @@ -244,3 +244,23 @@ def 解析一个Lua项目(txt, llm_kwargs, plugin_kwargs, chatbot, history, syst yield from update_ui(chatbot=chatbot, history=history) # 刷新界面 return yield from 解析源代码新(file_manifest, project_folder, llm_kwargs, plugin_kwargs, chatbot, history, system_prompt) + + +@CatchException +def 解析一个CSharp项目(txt, llm_kwargs, plugin_kwargs, chatbot, history, system_prompt, web_port): + history = [] # 清空历史,以免输入溢出 + import glob, os + if os.path.exists(txt): + project_folder = txt + else: + if txt == "": txt = '空空如也的输入栏' + report_execption(chatbot, history, a = f"解析项目: {txt}", b = f"找不到本地项目或无权访问: {txt}") + yield from update_ui(chatbot=chatbot, history=history) # 刷新界面 + return + file_manifest = [f for f in glob.glob(f'{project_folder}/**/*.cs', recursive=True)] + \ + [f for f in glob.glob(f'{project_folder}/**/*.csproj', recursive=True)] + if len(file_manifest) == 0: + report_execption(chatbot, history, a = f"解析项目: {txt}", b = f"找不到任何CSharp文件: {txt}") + yield from update_ui(chatbot=chatbot, history=history) # 刷新界面 + return + yield from 解析源代码新(file_manifest, project_folder, llm_kwargs, plugin_kwargs, chatbot, history, system_prompt)