diff --git a/main.py b/main.py index aa29e59..a480d5b 100644 --- a/main.py +++ b/main.py @@ -146,7 +146,7 @@ with gr.Blocks(theme=set_theme, analytics_enabled=False, css=advanced_css) as de # 随变按钮的回调函数注册 def route(k, *args, **kwargs): if k in [r"打开插件列表", r"请先从插件列表中选择"]: return - yield from ArgsGeneralWrapper(crazy_fns[k])["Function"](*args, **kwargs) + yield from ArgsGeneralWrapper(crazy_fns[k]["Function"])(*args, **kwargs) click_handle = switchy_bt.click(route,[switchy_bt, *input_combo, gr.State(PORT)], output_combo) click_handle.then(on_report_generated, [file_upload, chatbot], [file_upload, chatbot]) # def expand_file_area(file_upload, area_file_up): diff --git a/toolbox.py b/toolbox.py index 011cb44..c28767e 100644 --- a/toolbox.py +++ b/toolbox.py @@ -10,7 +10,6 @@ def ArgsGeneralWrapper(f): txt_passon = txt if txt == "" and txt2 != "": txt_passon = txt2 yield from f(txt_passon, *args, **kwargs) - return decorated @@ -141,7 +140,7 @@ def HotReload(f): def decorated(*args, **kwargs): fn_name = f.__name__ f_hot_reload = getattr(importlib.reload(inspect.getmodule(f)), fn_name) - yield from ArgsGeneralWrapper(f_hot_reload)(*args, **kwargs) + yield from f_hot_reload(*args, **kwargs) return decorated def report_execption(chatbot, history, a, b):