Spaces:
				
			
			
	
			
			
		Runtime error
		
	
	
	
			
			
	
	
	
	
		
		
		Runtime error
		
	Merge branch 'master' into v3.1
Browse files- README.md +3 -3
- crazy_functional.py +6 -0
- crazy_functions/解析项目源代码.py +20 -0
    	
        README.md
    CHANGED
    
    | @@ -34,8 +34,8 @@ chat分析报告生成 | [函数插件] 运行后自动生成总结汇报 | |
| 34 | 
             
            公式/图片/表格显示 | 可以同时显示公式的tex形式和渲染形式,支持公式、代码高亮
         | 
| 35 | 
             
            多线程函数插件支持 | 支持多线调用chatgpt,一键处理海量文本或程序
         | 
| 36 | 
             
            启动暗色gradio[主题](https://github.com/binary-husky/chatgpt_academic/issues/173) | 在浏览器url后面添加```/?__dark-theme=true```可以切换dark主题
         | 
| 37 | 
            -
            [多LLM模型](https://www.bilibili.com/video/BV1EM411K7VH/)支持([v3. | 
| 38 | 
            -
            兼容[TGUI](https://github.com/oobabooga/text-generation-webui)接入更多样的语言模型 | 接入opt-1.3b, galactica-1.3b等模型([v3. | 
| 39 | 
             
            huggingface免科学上网[在线体验](https://huggingface.co/spaces/qingxu98/gpt-academic) | 登陆huggingface后复制[此空间](https://huggingface.co/spaces/qingxu98/gpt-academic)
         | 
| 40 | 
             
            …… | ……
         | 
| 41 |  | 
| @@ -68,7 +68,7 @@ huggingface免科学上网[在线体验](https://huggingface.co/spaces/qingxu98/ | |
| 68 | 
             
            <img src="https://user-images.githubusercontent.com/96192199/226935232-6b6a73ce-8900-4aee-93f9-733c7e6fef53.png" width="700" >
         | 
| 69 | 
             
            </div>
         | 
| 70 |  | 
| 71 | 
            -
            - 多种大语言模型混合调用([v3. | 
| 72 | 
             
            <div align="center">
         | 
| 73 | 
             
            <img src="https://user-images.githubusercontent.com/96192199/231222778-34776885-a7f0-4f2c-b5f4-7cc2ef3ecb58.png" width="700" >
         | 
| 74 | 
             
            </div>
         | 
|  | |
| 34 | 
             
            公式/图片/表格显示 | 可以同时显示公式的tex形式和渲染形式,支持公式、代码高亮
         | 
| 35 | 
             
            多线程函数插件支持 | 支持多线调用chatgpt,一键处理海量文本或程序
         | 
| 36 | 
             
            启动暗色gradio[主题](https://github.com/binary-husky/chatgpt_academic/issues/173) | 在浏览器url后面添加```/?__dark-theme=true```可以切换dark主题
         | 
| 37 | 
            +
            [多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)伺候的感觉一定会很不错吧?
         | 
| 38 | 
            +
            兼容[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)测试中)
         | 
| 39 | 
             
            huggingface免科学上网[在线体验](https://huggingface.co/spaces/qingxu98/gpt-academic) | 登陆huggingface后复制[此空间](https://huggingface.co/spaces/qingxu98/gpt-academic)
         | 
| 40 | 
             
            …… | ……
         | 
| 41 |  | 
|  | |
| 68 | 
             
            <img src="https://user-images.githubusercontent.com/96192199/226935232-6b6a73ce-8900-4aee-93f9-733c7e6fef53.png" width="700" >
         | 
| 69 | 
             
            </div>
         | 
| 70 |  | 
| 71 | 
            +
            - 多种大语言模型混合调用([v3.1分支](https://github.com/binary-husky/chatgpt_academic/tree/v3.1)测试中)
         | 
| 72 | 
             
            <div align="center">
         | 
| 73 | 
             
            <img src="https://user-images.githubusercontent.com/96192199/231222778-34776885-a7f0-4f2c-b5f4-7cc2ef3ecb58.png" width="700" >
         | 
| 74 | 
             
            </div>
         | 
    	
        crazy_functional.py
    CHANGED
    
    | @@ -18,6 +18,7 @@ def get_crazy_functions(): | |
| 18 | 
             
                from crazy_functions.Latex全文润色 import Latex英文润色
         | 
| 19 | 
             
                from crazy_functions.询问多个大语言模型 import 同时问询
         | 
| 20 | 
             
                from crazy_functions.解析项目源代码 import 解析一个Lua项目
         | 
|  | |
| 21 | 
             
                function_plugins = {
         | 
| 22 | 
             
                    "询问多个GPT模型": {
         | 
| 23 | 
             
                        "Color": "stop",    # 按钮颜色
         | 
| @@ -57,6 +58,11 @@ def get_crazy_functions(): | |
| 57 | 
             
                        "AsButton": False,  # 加入下拉菜单中
         | 
| 58 | 
             
                        "Function": HotReload(解析一个Lua项目)
         | 
| 59 | 
             
                    },
         | 
|  | |
|  | |
|  | |
|  | |
|  | |
| 60 | 
             
                    "读Tex论文写摘要": {
         | 
| 61 | 
             
                        "Color": "stop",    # 按钮颜色
         | 
| 62 | 
             
                        "Function": HotReload(读文章写摘要)
         | 
|  | |
| 18 | 
             
                from crazy_functions.Latex全文润色 import Latex英文润色
         | 
| 19 | 
             
                from crazy_functions.询问多个大语言模型 import 同时问询
         | 
| 20 | 
             
                from crazy_functions.解析项目源代码 import 解析一个Lua项目
         | 
| 21 | 
            +
                from crazy_functions.解析项目源代码 import 解析一个CSharp项目
         | 
| 22 | 
             
                function_plugins = {
         | 
| 23 | 
             
                    "询问多个GPT模型": {
         | 
| 24 | 
             
                        "Color": "stop",    # 按钮颜色
         | 
|  | |
| 58 | 
             
                        "AsButton": False,  # 加入下拉菜单中
         | 
| 59 | 
             
                        "Function": HotReload(解析一个Lua项目)
         | 
| 60 | 
             
                    },
         | 
| 61 | 
            +
                    "解析整个CSharp项目": {
         | 
| 62 | 
            +
                        "Color": "stop",    # 按钮颜色
         | 
| 63 | 
            +
                        "AsButton": False,  # 加入下拉菜单中
         | 
| 64 | 
            +
                        "Function": HotReload(解析一个CSharp项目)
         | 
| 65 | 
            +
                    },
         | 
| 66 | 
             
                    "读Tex论文写摘要": {
         | 
| 67 | 
             
                        "Color": "stop",    # 按钮颜色
         | 
| 68 | 
             
                        "Function": HotReload(读文章写摘要)
         | 
    	
        crazy_functions/解析项目源代码.py
    CHANGED
    
    | @@ -244,3 +244,23 @@ def 解析一个Lua项目(txt, llm_kwargs, plugin_kwargs, chatbot, history, syst | |
| 244 | 
             
                    yield from update_ui(chatbot=chatbot, history=history) # 刷新界面
         | 
| 245 | 
             
                    return
         | 
| 246 | 
             
                yield from 解析源代码新(file_manifest, project_folder, llm_kwargs, plugin_kwargs, chatbot, history, system_prompt)    
         | 
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | 
|  | |
| 244 | 
             
                    yield from update_ui(chatbot=chatbot, history=history) # 刷新界面
         | 
| 245 | 
             
                    return
         | 
| 246 | 
             
                yield from 解析源代码新(file_manifest, project_folder, llm_kwargs, plugin_kwargs, chatbot, history, system_prompt)    
         | 
| 247 | 
            +
                
         | 
| 248 | 
            +
                    
         | 
| 249 | 
            +
            @CatchException
         | 
| 250 | 
            +
            def 解析一个CSharp项目(txt, llm_kwargs, plugin_kwargs, chatbot, history, system_prompt, web_port):
         | 
| 251 | 
            +
                history = []    # 清空历史,以免输入溢出
         | 
| 252 | 
            +
                import glob, os
         | 
| 253 | 
            +
                if os.path.exists(txt):
         | 
| 254 | 
            +
                    project_folder = txt
         | 
| 255 | 
            +
                else:
         | 
| 256 | 
            +
                    if txt == "": txt = '空空如也的输入栏'
         | 
| 257 | 
            +
                    report_execption(chatbot, history, a = f"解析项目: {txt}", b = f"找不到本地项目或无权访问: {txt}")
         | 
| 258 | 
            +
                    yield from update_ui(chatbot=chatbot, history=history) # 刷新界面
         | 
| 259 | 
            +
                    return
         | 
| 260 | 
            +
                file_manifest = [f for f in glob.glob(f'{project_folder}/**/*.cs', recursive=True)] + \
         | 
| 261 | 
            +
                                [f for f in glob.glob(f'{project_folder}/**/*.csproj', recursive=True)]
         | 
| 262 | 
            +
                if len(file_manifest) == 0:
         | 
| 263 | 
            +
                    report_execption(chatbot, history, a = f"解析项目: {txt}", b = f"找不到任何CSharp文件: {txt}")
         | 
| 264 | 
            +
                    yield from update_ui(chatbot=chatbot, history=history) # 刷新界面
         | 
| 265 | 
            +
                    return
         | 
| 266 | 
            +
                yield from 解析源代码新(file_manifest, project_folder, llm_kwargs, plugin_kwargs, chatbot, history, system_prompt)    
         | 
