From a75ae327e7b8fe57d3fb671cda14303dfe8f1de5 Mon Sep 17 00:00:00 2001 From: kainstan Date: Tue, 6 Jun 2023 08:23:56 +0800 Subject: [PATCH] Make it comply with the PEP8 standard and improve PEP 8: E401 multiple imports on one line and PEP 8: E701 multiple statements on one line (colon) --- crazy_functions/读文章写摘要.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/crazy_functions/读文章写摘要.py b/crazy_functions/读文章写摘要.py index 044eb37..2edf83a 100644 --- a/crazy_functions/读文章写摘要.py +++ b/crazy_functions/读文章写摘要.py @@ -6,7 +6,8 @@ fast_debug = False def 解析Paper(file_manifest, project_folder, llm_kwargs, plugin_kwargs, chatbot, history, system_prompt): - import time, os + import time + import os print('begin analysis on:', file_manifest) for index, fp in enumerate(file_manifest): with open(fp, 'r', encoding='utf-8', errors='replace') as f: @@ -44,7 +45,7 @@ def 解析Paper(file_manifest, project_folder, llm_kwargs, plugin_kwargs, chatbo sys_prompt=system_prompt) # 带超时倒计时 chatbot[-1] = (i_say, gpt_say) - history.append(i_say); + history.append(i_say) history.append(gpt_say) yield from update_ui(chatbot=chatbot, history=history, msg=msg) # 刷新界面 res = write_results_to_file(history) @@ -62,7 +63,8 @@ def 读文章写摘要(txt, llm_kwargs, plugin_kwargs, chatbot, system_prompt, w if os.path.exists(txt): project_folder = txt else: - if txt == "": txt = '空空如也的输入栏' + if txt == "": + txt = '空空如也的输入栏' report_execption(chatbot, history, a=f"解析项目: {txt}", b=f"找不到本地项目或无权访问: {txt}") yield from update_ui(chatbot=chatbot, history=history) # 刷新界面 return