qingxu99 commited on
Commit
2bb1f3d
2 Parent(s): 8295288 971b45f

Merge branch 'dev_ui' of https://github.com/binary-husky/chatgpt_academic into dev_ui

Browse files
Files changed (2) hide show
  1. main.py +1 -1
  2. toolbox.py +1 -2
main.py CHANGED
@@ -146,7 +146,7 @@ with gr.Blocks(theme=set_theme, analytics_enabled=False, css=advanced_css) as de
146
  # 随变按钮的回调函数注册
147
  def route(k, *args, **kwargs):
148
  if k in [r"打开插件列表", r"请先从插件列表中选择"]: return
149
- yield from ArgsGeneralWrapper(crazy_fns[k])["Function"](*args, **kwargs)
150
  click_handle = switchy_bt.click(route,[switchy_bt, *input_combo, gr.State(PORT)], output_combo)
151
  click_handle.then(on_report_generated, [file_upload, chatbot], [file_upload, chatbot])
152
  # def expand_file_area(file_upload, area_file_up):
 
146
  # 随变按钮的回调函数注册
147
  def route(k, *args, **kwargs):
148
  if k in [r"打开插件列表", r"请先从插件列表中选择"]: return
149
+ yield from ArgsGeneralWrapper(crazy_fns[k]["Function"])(*args, **kwargs)
150
  click_handle = switchy_bt.click(route,[switchy_bt, *input_combo, gr.State(PORT)], output_combo)
151
  click_handle.then(on_report_generated, [file_upload, chatbot], [file_upload, chatbot])
152
  # def expand_file_area(file_upload, area_file_up):
toolbox.py CHANGED
@@ -10,7 +10,6 @@ def ArgsGeneralWrapper(f):
10
  txt_passon = txt
11
  if txt == "" and txt2 != "": txt_passon = txt2
12
  yield from f(txt_passon, *args, **kwargs)
13
-
14
  return decorated
15
 
16
 
@@ -141,7 +140,7 @@ def HotReload(f):
141
  def decorated(*args, **kwargs):
142
  fn_name = f.__name__
143
  f_hot_reload = getattr(importlib.reload(inspect.getmodule(f)), fn_name)
144
- yield from ArgsGeneralWrapper(f_hot_reload)(*args, **kwargs)
145
  return decorated
146
 
147
  def report_execption(chatbot, history, a, b):
 
10
  txt_passon = txt
11
  if txt == "" and txt2 != "": txt_passon = txt2
12
  yield from f(txt_passon, *args, **kwargs)
 
13
  return decorated
14
 
15
 
 
140
  def decorated(*args, **kwargs):
141
  fn_name = f.__name__
142
  f_hot_reload = getattr(importlib.reload(inspect.getmodule(f)), fn_name)
143
+ yield from f_hot_reload(*args, **kwargs)
144
  return decorated
145
 
146
  def report_execption(chatbot, history, a, b):