From a14ef78d52a9f900141dbe2e092a1b6e4136fe25 Mon Sep 17 00:00:00 2001 From: binary-husky Date: Sun, 22 Oct 2023 00:05:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=B9=E5=BF=8Dtex=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E7=9A=84=E7=BC=BA=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crazy_functional.py | 24 +++++++++++----------- crazy_functions/latex_fns/latex_toolbox.py | 5 ++++- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/crazy_functional.py b/crazy_functional.py index c11e7cb..795bd5f 100644 --- a/crazy_functional.py +++ b/crazy_functional.py @@ -539,18 +539,18 @@ def get_crazy_functions(): except: print('Load function plugin failed') - try: - from crazy_functions.多智能体 import 多智能体终端 - function_plugins.update({ - "多智能体终端(微软AutoGen)": { - "Group": "智能体", - "Color": "stop", - "AsButton": True, - "Function": HotReload(多智能体终端) - } - }) - except: - print('Load function plugin failed') + # try: + # from crazy_functions.多智能体 import 多智能体终端 + # function_plugins.update({ + # "多智能体终端(微软AutoGen)": { + # "Group": "智能体", + # "Color": "stop", + # "AsButton": True, + # "Function": HotReload(多智能体终端) + # } + # }) + # except: + # print('Load function plugin failed') # try: # from crazy_functions.chatglm微调工具 import 微调数据集生成 diff --git a/crazy_functions/latex_fns/latex_toolbox.py b/crazy_functions/latex_fns/latex_toolbox.py index 0d5554f..330cb65 100644 --- a/crazy_functions/latex_fns/latex_toolbox.py +++ b/crazy_functions/latex_fns/latex_toolbox.py @@ -308,7 +308,10 @@ def merge_tex_files_(project_foler, main_file, mode): fp = os.path.join(project_foler, f) fp_ = find_tex_file_ignore_case(fp) if fp_: - with open(fp_, 'r', encoding='utf-8', errors='replace') as fx: c = fx.read() + try: + with open(fp_, 'r', encoding='utf-8', errors='replace') as fx: c = fx.read() + except: + c = f"\n\nWarning from GPT-Academic: LaTex source file is missing!\n\n" else: raise RuntimeError(f'找不到{fp},Tex源文件缺失!') c = merge_tex_files_(project_foler, c, mode)