diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml deleted file mode 100644 index fd16ba2dc..000000000 --- a/.pre-commit-config.yaml +++ /dev/null @@ -1,10 +0,0 @@ -# See https://pre-commit.com for more information -# See https://pre-commit.com/hooks.html for more hooks -repos: -- repo: https://github.com/pre-commit/pre-commit-hooks - rev: v3.2.0 - hooks: - - id: trailing-whitespace - - id: end-of-file-fixer - - id: check-yaml - - id: check-added-large-files diff --git a/config.py b/config.py index a51778b2c..ea603c3bf 100644 --- a/config.py +++ b/config.py @@ -235,11 +235,6 @@ # 自定义按钮的最大数量限制 NUM_CUSTOM_BASIC_BTN = 4 - -# LATEX实验性功能 -LATEX_EXPERIMENTAL = False - - """ 在线大模型配置关联关系示意图 │ diff --git a/crazy_functions/latex_fns/latex_actions.py b/crazy_functions/latex_fns/latex_actions.py index c51e98582..74e8757e6 100644 --- a/crazy_functions/latex_fns/latex_actions.py +++ b/crazy_functions/latex_fns/latex_actions.py @@ -95,11 +95,14 @@ def __init__(self) -> None: self.abstract = "unknown" def read_title_and_abstract(self, txt): - title, abstract = find_title_and_abs(txt) - if title is not None: - self.title = title.replace('\n', ' ').replace('\\\\', ' ').replace(' ', '').replace(' ', '') - if abstract is not None: - self.abstract = abstract.replace('\n', ' ').replace('\\\\', ' ').replace(' ', '').replace(' ', '') + try: + title, abstract = find_title_and_abs(txt) + if title is not None: + self.title = title.replace('\n', ' ').replace('\\\\', ' ').replace(' ', '').replace(' ', '') + if abstract is not None: + self.abstract = abstract.replace('\n', ' ').replace('\\\\', ' ').replace(' ', '').replace(' ', '') + except: + pass def merge_result(self, arr, mode, msg, buggy_lines=[], buggy_line_surgery_n_lines=10): """ @@ -265,12 +268,12 @@ def Latex精细分解与转化(file_manifest, project_folder, llm_kwargs, plugin else: # <-------- gpt 多线程请求 ----------> - LATEX_EXPERIMENTAL, = get_conf('LATEX_EXPERIMENTAL') history_array = [[""] for _ in range(n_split)] - if LATEX_EXPERIMENTAL: - paper_meta = f"The paper you processing is `{lps.title}`, a part of the abstraction is `{lps.abstract}`" - paper_meta_max_len = 888 - history_array = [[ paper_meta[:paper_meta_max_len] + '...', "Understand, what should I do?"] for _ in range(n_split)] + # LATEX_EXPERIMENTAL, = get_conf('LATEX_EXPERIMENTAL') + # if LATEX_EXPERIMENTAL: + # paper_meta = f"The paper you processing is `{lps.title}`, a part of the abstraction is `{lps.abstract}`" + # paper_meta_max_len = 888 + # history_array = [[ paper_meta[:paper_meta_max_len] + '...', "Understand, what should I do?"] for _ in range(n_split)] gpt_response_collection = yield from request_gpt_model_multi_threads_with_very_awesome_ui_and_high_efficiency( inputs_array=inputs_array, diff --git a/crazy_functions/latex_fns/latex_toolbox.py b/crazy_functions/latex_fns/latex_toolbox.py index b56825aa6..afa65bf94 100644 --- a/crazy_functions/latex_fns/latex_toolbox.py +++ b/crazy_functions/latex_fns/latex_toolbox.py @@ -352,6 +352,7 @@ def extract_title(string): title = extract_title(main_file) return title, abstract + def merge_tex_files(project_foler, main_file, mode): """ Merge Tex project recrusively diff --git a/toolbox.py b/toolbox.py index 4376f0505..8747afdb8 100644 --- a/toolbox.py +++ b/toolbox.py @@ -544,14 +544,16 @@ def find_recent_files(directory): def file_already_in_downloadzone(file, user_path): - parent_path = user_path - child_path = file - if os.path.commonpath([parent_path, child_path]) == parent_path: - return True - else: + try: + parent_path = os.path.abspath(user_path) + child_path = os.path.abspath(file) + if os.path.samefile(os.path.commonpath([parent_path, child_path]), parent_path): + return True + else: + return False + except: return False - def promote_file_to_downloadzone(file, rename_file=None, chatbot=None): # 将文件复制一份到下载区 import shutil @@ -564,6 +566,7 @@ def promote_file_to_downloadzone(file, rename_file=None, chatbot=None): if file_already_in_downloadzone(file, user_path): new_path = file else: + user_path = get_log_folder(user_name, plugin_name='downloadzone') if rename_file is None: rename_file = f'{gen_time_str()}-{os.path.basename(file)}' new_path = pj(user_path, rename_file) # 如果已经存在,先删除 diff --git a/version b/version index 81ad2fd93..cf14e82bf 100644 --- a/version +++ b/version @@ -1,5 +1,5 @@ { "version": 3.60, "show_feature": true, - "new_feature": "11月12日紧急BUG修复 <-> AutoGen多智能体插件测试版 <-> 修复本地模型在Windows下的加载BUG <-> 支持文心一言v4和星火v3 <-> 支持GLM3和智谱的API <-> 解决本地模型并发BUG <-> 支持动态追加基础功能按钮 <-> 新汇报PDF汇总页面 <-> 重新编译Gradio优化使用体验" + "new_feature": "修复多个BUG <-> AutoGen多智能体插件测试版 <-> 修复本地模型在Windows下的加载BUG <-> 支持文心一言v4和星火v3 <-> 支持GLM3和智谱的API <-> 解决本地模型并发BUG <-> 支持动态追加基础功能按钮 <-> 新汇报PDF汇总页面 <-> 重新编译Gradio优化使用体验" }