From f40d48b0144d425dbe619d1740ee15c322678c77 Mon Sep 17 00:00:00 2001 From: qingxu fu <505030475@qq.com> Date: Tue, 29 Aug 2023 23:46:40 +0800 Subject: [PATCH] fix typing problems --- crazy_functional.py | 2 ++ crazy_functions/vt_fns/vt_call_plugin.py | 4 ++-- crazy_functions/vt_fns/vt_modify_config.py | 2 +- crazy_functions/批量Markdown翻译.py | 2 ++ crazy_functions/虚空终端.py | 2 -- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/crazy_functional.py b/crazy_functional.py index e83dd59..fcc4e52 100644 --- a/crazy_functional.py +++ b/crazy_functional.py @@ -282,6 +282,7 @@ def get_crazy_functions(): "AsButton": False, "AdvancedArgs": True, # 调用时,唤起高级参数输入区(默认False) "ArgsReminder": "在这里输入分辨率, 如256x256(默认)", # 高级参数输入区的显示提示 + "Info": "图片生成 | 输入参数字符串,提供图像的内容", "Function": HotReload(图片生成) }, }) @@ -296,6 +297,7 @@ def get_crazy_functions(): "AsButton": False, "AdvancedArgs": True, "ArgsReminder": "调用openai api 使用whisper-1模型, 目前支持的格式:mp4, m4a, wav, mpga, mpeg, mp3。此处可以输入解析提示,例如:解析为简体中文(默认)。", + "Info": "批量总结音频或视频 | 输入参数为路径", "Function": HotReload(总结音视频) } }) diff --git a/crazy_functions/vt_fns/vt_call_plugin.py b/crazy_functions/vt_fns/vt_call_plugin.py index 1871010..4bc963a 100644 --- a/crazy_functions/vt_fns/vt_call_plugin.py +++ b/crazy_functions/vt_fns/vt_call_plugin.py @@ -27,7 +27,7 @@ def execute_plugin(txt, llm_kwargs, plugin_kwargs, chatbot, history, system_prom gpt_json_io = GptJsonIO(Plugin) gpt_json_io.format_instructions += plugin_arr_enum_prompt inputs = "Choose the correct plugin and extract plugin_arg, the user requirement is: \n\n" + \ - ">>" + txt + '\n\n' + \ + ">> " + txt.rstrip('\n').replace('\n','\n>> ') + '\n\n' + \ gpt_json_io.format_instructions run_gpt_fn = lambda inputs, sys_prompt: predict_no_ui_long_connection( inputs=inputs, llm_kwargs=llm_kwargs, history=[], sys_prompt=sys_prompt, observe_window=[]) @@ -38,7 +38,7 @@ def execute_plugin(txt, llm_kwargs, plugin_kwargs, chatbot, history, system_prom plugin = plugin_arr_dict[plugin_sel.plugin_selection] fn = plugin['Function'] fn_name = fn.__name__ - msg = f'正在调用插件: {fn_name}\n\n插件说明:{plugin["Info"]}' + msg = f'正在调用插件: {fn_name}\n\n插件说明:{plugin["Info"]}\n\n插件参数:{plugin_sel.plugin_arg}' yield from update_ui_lastest_msg(lastmsg=msg, chatbot=chatbot, history=history, delay=2) yield from fn(plugin_sel.plugin_arg, llm_kwargs, plugin_kwargs, chatbot, history, system_prompt, -1) return diff --git a/crazy_functions/vt_fns/vt_modify_config.py b/crazy_functions/vt_fns/vt_modify_config.py index 1f84ae6..e7fd745 100644 --- a/crazy_functions/vt_fns/vt_modify_config.py +++ b/crazy_functions/vt_fns/vt_modify_config.py @@ -33,7 +33,7 @@ def modify_configuration_hot(txt, llm_kwargs, plugin_kwargs, chatbot, history, s yield from update_ui_lastest_msg(lastmsg=f"正在执行任务: {txt}\n\n读取新配置中", chatbot=chatbot, history=history, delay=0) gpt_json_io = GptJsonIO(ModifyConfigurationIntention) inputs = "Analyze how to change configuration according to following user input, answer me with json: \n\n" + \ - ">>" + txt + '\n\n' + \ + ">> " + txt.rstrip('\n').replace('\n','\n>> ') + '\n\n' + \ gpt_json_io.format_instructions run_gpt_fn = lambda inputs, sys_prompt: predict_no_ui_long_connection( diff --git a/crazy_functions/批量Markdown翻译.py b/crazy_functions/批量Markdown翻译.py index ea8dee9..8af9864 100644 --- a/crazy_functions/批量Markdown翻译.py +++ b/crazy_functions/批量Markdown翻译.py @@ -145,6 +145,8 @@ def get_files_from_everything(txt, preference=''): project_folder = txt file_manifest = [f for f in glob.glob(f'{project_folder}/**/*.md', recursive=True)] else: + project_folder = None + file_manifest = [] success = False return success, file_manifest, project_folder diff --git a/crazy_functions/虚空终端.py b/crazy_functions/虚空终端.py index e60ccfe..da16527 100644 --- a/crazy_functions/虚空终端.py +++ b/crazy_functions/虚空终端.py @@ -94,8 +94,6 @@ def 自动终端(txt, llm_kwargs, plugin_kwargs, chatbot, history, system_prompt if user_intention.intention_type == 'Chat': yield from chat(txt, llm_kwargs, plugin_kwargs, chatbot, history, system_prompt, user_intention) - # update_vt_state() - return