Spaces:
				
			
			
	
			
			
		Runtime error
		
	
	
	
			
			
	
	
	
	
		
		
		Runtime error
		
	Merge remote-tracking branch 'origin/master' into dev_ui
Browse files- README.md +23 -18
- crazy_functions/解析项目源代码.py +3 -2
- toolbox.py +1 -1
    	
        README.md
    CHANGED
    
    | @@ -6,18 +6,6 @@ | |
| 6 |  | 
| 7 | 
             
            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 (to `dev` branch).
         | 
| 8 |  | 
| 9 | 
            -
            ```
         | 
| 10 | 
            -
            代码中参考了很多其他优秀项目中的设计,主要包括:
         | 
| 11 | 
            -
             | 
| 12 | 
            -
            # 借鉴项目1:借鉴了ChuanhuChatGPT中读取OpenAI json的方法、记录历史问询记录的方法以及gradio queue的使用技巧
         | 
| 13 | 
            -
            https://github.com/GaiZhenbiao/ChuanhuChatGPT
         | 
| 14 | 
            -
             | 
| 15 | 
            -
            # 借鉴项目2:借鉴了mdtex2html中公式处理的方法
         | 
| 16 | 
            -
            https://github.com/polarwinkel/mdtex2html
         | 
| 17 | 
            -
             | 
| 18 | 
            -
            项目使用OpenAI的gpt-3.5-turbo模型,期待gpt-4早点放宽门槛😂
         | 
| 19 | 
            -
            ```
         | 
| 20 | 
            -
             | 
| 21 | 
             
            > **Note**
         | 
| 22 | 
             
            >
         | 
| 23 | 
             
            > 1.请注意只有“红颜色”标识的函数插件(按钮)才支持读取文件。目前对pdf/word格式文件的支持插件正在逐步完善中,需要更多developer的帮助。
         | 
| @@ -25,6 +13,8 @@ https://github.com/polarwinkel/mdtex2html | |
| 25 | 
             
            > 2.本项目中每个文件的功能都在自译解[`self_analysis.md`](https://github.com/binary-husky/chatgpt_academic/wiki/chatgpt-academic%E9%A1%B9%E7%9B%AE%E8%87%AA%E8%AF%91%E8%A7%A3%E6%8A%A5%E5%91%8A)详细说明。随着版本的迭代,您也可以随时自行点击相关函数插件,调用GPT重新生成项目的自我解析报告。常见问题汇总在[`wiki`](https://github.com/binary-husky/chatgpt_academic/wiki/%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98)当中。
         | 
| 26 | 
             
            > 
         | 
| 27 | 
             
            > 3.如果您不太习惯部分中文命名的函数、注释或者界面,您可以随时点击相关函数插件,调用ChatGPT一键生成纯英文的项目源代码。
         | 
|  | |
|  | |
| 28 |  | 
| 29 | 
             
            <div align="center">
         | 
| 30 |  | 
| @@ -33,15 +23,15 @@ https://github.com/polarwinkel/mdtex2html | |
| 33 | 
             
            一键润色 | 支持一键润色、一键查找论文语法错误
         | 
| 34 | 
             
            一键中英互译 | 一键中英互译
         | 
| 35 | 
             
            一键代码解释 | 可以正确显示代码、解释代码
         | 
| 36 | 
            -
            自定义快捷键 | 支持自定义快捷键
         | 
| 37 | 
            -
            配置代理服务器 | 支持配置代理服务器
         | 
| 38 | 
             
            模块化设计 | 支持自定义高阶的实验性功能与[函数插件],插件支持[热更新](https://github.com/binary-husky/chatgpt_academic/wiki/%E5%87%BD%E6%95%B0%E6%8F%92%E4%BB%B6%E6%8C%87%E5%8D%97)
         | 
| 39 | 
            -
            自我程序剖析 | [函数插件] 一键读懂本项目的源代码
         | 
| 40 | 
            -
            程序剖析 | [函数插件] 一键可以剖析其他Python/C/C++/Java项目树
         | 
| 41 | 
             
            读论文 | [函数插件] 一键解读latex论文全文并生成摘要
         | 
| 42 | 
             
            批量注释生成 | [函数插件] 一键批量生成函数注释
         | 
| 43 | 
             
            chat分析报告生成 | [函数插件] 运行后自动生成总结汇报
         | 
| 44 | 
            -
            arxiv小助手 | [函数插件] 输入arxiv文章url即可一键翻译摘要+下载PDF
         | 
| 45 | 
             
            公式显示 | 可以同时显示公式的tex形式和渲染形式
         | 
| 46 | 
             
            图片显示 | 可以在markdown中显示图片
         | 
| 47 | 
             
            多线程函数插件支持 | 支持多线调用chatgpt,一键处理海量文本或程序
         | 
| @@ -277,4 +267,19 @@ python check_proxy.py | |
| 277 | 
             
            - version 2.2: 函数插件支持热重载
         | 
| 278 | 
             
            - version 2.1: 可折叠式布局
         | 
| 279 | 
             
            - version 2.0: 引入模块化函数插件
         | 
| 280 | 
            -
            - version 1.0: 基础功能
         | 
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | 
|  | |
| 6 |  | 
| 7 | 
             
            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 (to `dev` branch).
         | 
| 8 |  | 
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
| 9 | 
             
            > **Note**
         | 
| 10 | 
             
            >
         | 
| 11 | 
             
            > 1.请注意只有“红颜色”标识的函数插件(按钮)才支持读取文件。目前对pdf/word格式文件的支持插件正在逐步完善中,需要更多developer的帮助。
         | 
|  | |
| 13 | 
             
            > 2.本项目中每个文件的功能都在自译解[`self_analysis.md`](https://github.com/binary-husky/chatgpt_academic/wiki/chatgpt-academic%E9%A1%B9%E7%9B%AE%E8%87%AA%E8%AF%91%E8%A7%A3%E6%8A%A5%E5%91%8A)详细说明。随着版本的迭代,您也可以随时自行点击相关函数插件,调用GPT重新生成项目的自我解析报告。常见问题汇总在[`wiki`](https://github.com/binary-husky/chatgpt_academic/wiki/%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98)当中。
         | 
| 14 | 
             
            > 
         | 
| 15 | 
             
            > 3.如果您不太习惯部分中文命名的函数、注释或者界面,您可以随时点击相关函数插件,调用ChatGPT一键生成纯英文的项目源代码。
         | 
| 16 | 
            +
            >
         | 
| 17 | 
            +
            > 4.项目使用OpenAI的gpt-3.5-turbo模型,期待gpt-4早点放宽门槛😂
         | 
| 18 |  | 
| 19 | 
             
            <div align="center">
         | 
| 20 |  | 
|  | |
| 23 | 
             
            一键润色 | 支持一键润色、一键查找论文语法错误
         | 
| 24 | 
             
            一键中英互译 | 一键中英互译
         | 
| 25 | 
             
            一键代码解释 | 可以正确显示代码、解释代码
         | 
| 26 | 
            +
            [自定义快捷键](https://www.bilibili.com/video/BV14s4y1E7jN) | 支持自定义快捷键
         | 
| 27 | 
            +
            [配置代理服务器](https://www.bilibili.com/video/BV1rc411W7Dr) | 支持配置代理服务器
         | 
| 28 | 
             
            模块化设计 | 支持自定义高阶的实验性功能与[函数插件],插件支持[热更新](https://github.com/binary-husky/chatgpt_academic/wiki/%E5%87%BD%E6%95%B0%E6%8F%92%E4%BB%B6%E6%8C%87%E5%8D%97)
         | 
| 29 | 
            +
            [自我程序剖析](https://www.bilibili.com/video/BV1cj411A7VW) | [函数插件] 一键读懂本项目的源代码
         | 
| 30 | 
            +
            [程序剖析](https://www.bilibili.com/video/BV1cj411A7VW) | [函数插件] 一键可以剖析其他Python/C/C++/Java项目树
         | 
| 31 | 
             
            读论文 | [函数插件] 一键解读latex论文全文并生成摘要
         | 
| 32 | 
             
            批量注释生成 | [函数插件] 一键批量生成函数注释
         | 
| 33 | 
             
            chat分析报告生成 | [函数插件] 运行后自动生成总结汇报
         | 
| 34 | 
            +
            [arxiv小助手](https://www.bilibili.com/video/BV1LM4y1279X) | [函数插件] 输入arxiv文章url即可一键翻译摘要+下载PDF
         | 
| 35 | 
             
            公式显示 | 可以同时显示公式的tex形式和渲染形式
         | 
| 36 | 
             
            图片显示 | 可以在markdown中显示图片
         | 
| 37 | 
             
            多线程函数插件支持 | 支持多线调用chatgpt,一键处理海量文本或程序
         | 
|  | |
| 267 | 
             
            - version 2.2: 函数插件支持热重载
         | 
| 268 | 
             
            - version 2.1: 可折叠式布局
         | 
| 269 | 
             
            - version 2.0: 引入模块化函数插件
         | 
| 270 | 
            +
            - version 1.0: 基础功能
         | 
| 271 | 
            +
             | 
| 272 | 
            +
            ## 参考与学习
         | 
| 273 | 
            +
             | 
| 274 | 
            +
             | 
| 275 | 
            +
            ```
         | 
| 276 | 
            +
            代码中参考了很多其他优秀项目中的设计,主要包括:
         | 
| 277 | 
            +
             | 
| 278 | 
            +
            # 借鉴项目1:借鉴了ChuanhuChatGPT中读取OpenAI json的方法、记录历史问询记录的方法以及gradio queue的使用技巧
         | 
| 279 | 
            +
            https://github.com/GaiZhenbiao/ChuanhuChatGPT
         | 
| 280 | 
            +
             | 
| 281 | 
            +
            # 借鉴项目2:借鉴了mdtex2html中公式处理的方法
         | 
| 282 | 
            +
            https://github.com/polarwinkel/mdtex2html
         | 
| 283 | 
            +
             | 
| 284 | 
            +
             | 
| 285 | 
            +
            ```
         | 
    	
        crazy_functions/解析项目源代码.py
    CHANGED
    
    | @@ -119,8 +119,8 @@ def 解析一个C项目的头文件(txt, top_p, temperature, chatbot, history, s | |
| 119 | 
             
                    report_execption(chatbot, history, a = f"解析项目: {txt}", b = f"找不到本地项目或无权访问: {txt}")
         | 
| 120 | 
             
                    yield chatbot, history, '正常'
         | 
| 121 | 
             
                    return
         | 
| 122 | 
            -
                file_manifest = [f for f in glob.glob(f'{project_folder}/**/*.h', recursive=True)] | 
| 123 | 
            -
                                 | 
| 124 | 
             
                                # [f for f in glob.glob(f'{project_folder}/**/*.c', recursive=True)]
         | 
| 125 | 
             
                if len(file_manifest) == 0:
         | 
| 126 | 
             
                    report_execption(chatbot, history, a = f"解析项目: {txt}", b = f"找不到任何.h头文件: {txt}")
         | 
| @@ -141,6 +141,7 @@ def 解析一个C项目(txt, top_p, temperature, chatbot, history, systemPromptT | |
| 141 | 
             
                    return
         | 
| 142 | 
             
                file_manifest = [f for f in glob.glob(f'{project_folder}/**/*.h', recursive=True)]  + \
         | 
| 143 | 
             
                                [f for f in glob.glob(f'{project_folder}/**/*.cpp', recursive=True)] + \
         | 
|  | |
| 144 | 
             
                                [f for f in glob.glob(f'{project_folder}/**/*.c', recursive=True)]
         | 
| 145 | 
             
                if len(file_manifest) == 0:
         | 
| 146 | 
             
                    report_execption(chatbot, history, a = f"解析项目: {txt}", b = f"找不到任何.h头文件: {txt}")
         | 
|  | |
| 119 | 
             
                    report_execption(chatbot, history, a = f"解析项目: {txt}", b = f"找不到本地项目或无权访问: {txt}")
         | 
| 120 | 
             
                    yield chatbot, history, '正常'
         | 
| 121 | 
             
                    return
         | 
| 122 | 
            +
                file_manifest = [f for f in glob.glob(f'{project_folder}/**/*.h', recursive=True)]  + \
         | 
| 123 | 
            +
                                [f for f in glob.glob(f'{project_folder}/**/*.hpp', recursive=True)] #+ \
         | 
| 124 | 
             
                                # [f for f in glob.glob(f'{project_folder}/**/*.c', recursive=True)]
         | 
| 125 | 
             
                if len(file_manifest) == 0:
         | 
| 126 | 
             
                    report_execption(chatbot, history, a = f"解析项目: {txt}", b = f"找不到任何.h头文件: {txt}")
         | 
|  | |
| 141 | 
             
                    return
         | 
| 142 | 
             
                file_manifest = [f for f in glob.glob(f'{project_folder}/**/*.h', recursive=True)]  + \
         | 
| 143 | 
             
                                [f for f in glob.glob(f'{project_folder}/**/*.cpp', recursive=True)] + \
         | 
| 144 | 
            +
                                [f for f in glob.glob(f'{project_folder}/**/*.hpp', recursive=True)] + \
         | 
| 145 | 
             
                                [f for f in glob.glob(f'{project_folder}/**/*.c', recursive=True)]
         | 
| 146 | 
             
                if len(file_manifest) == 0:
         | 
| 147 | 
             
                    report_execption(chatbot, history, a = f"解析项目: {txt}", b = f"找不到任何.h头文件: {txt}")
         | 
    	
        toolbox.py
    CHANGED
    
    | @@ -314,7 +314,7 @@ def on_file_uploaded(files, chatbot, txt): | |
| 314 | 
             
            def on_report_generated(files, chatbot):
         | 
| 315 | 
             
                from toolbox import find_recent_files
         | 
| 316 | 
             
                report_files = find_recent_files('gpt_log')
         | 
| 317 | 
            -
                if len(report_files) == 0: return  | 
| 318 | 
             
                # files.extend(report_files)
         | 
| 319 | 
             
                chatbot.append(['汇总报告如何远程获取?', '汇总报告已经添加到右侧“文件上传区”(可能处于折叠状态),请查收。'])
         | 
| 320 | 
             
                return report_files, chatbot
         | 
|  | |
| 314 | 
             
            def on_report_generated(files, chatbot):
         | 
| 315 | 
             
                from toolbox import find_recent_files
         | 
| 316 | 
             
                report_files = find_recent_files('gpt_log')
         | 
| 317 | 
            +
                if len(report_files) == 0: return None, chatbot
         | 
| 318 | 
             
                # files.extend(report_files)
         | 
| 319 | 
             
                chatbot.append(['汇总报告如何远程获取?', '汇总报告已经添加到右侧“文件上传区”(可能处于折叠状态),请查收。'])
         | 
| 320 | 
             
                return report_files, chatbot
         |