qingxu99 commited on
Commit
c46a8d2
1 Parent(s): d8540d4

修正参数默认值bug

Browse files
crazy_functions/图片生成.py CHANGED
@@ -55,6 +55,7 @@ def 图片生成(prompt, llm_kwargs, plugin_kwargs, chatbot, history, system_pro
55
  history = [] # 清空历史,以免输入溢出
56
  chatbot.append(("这是什么功能?", "[Local Message] 生成图像, 请先把模型切换至gpt-xxxx或者api2d-xxxx。如果中文效果不理想, 尝试Prompt。正在处理中 ....."))
57
  yield from update_ui(chatbot=chatbot, history=history) # 刷新界面 # 由于请求gpt需要一段时间,我们先及时地做一次界面更新
 
58
  resolution = plugin_kwargs.get("advanced_arg", '256x256')
59
  image_url, image_path = gen_image(llm_kwargs, prompt, resolution)
60
  chatbot.append([prompt,
 
55
  history = [] # 清空历史,以免输入溢出
56
  chatbot.append(("这是什么功能?", "[Local Message] 生成图像, 请先把模型切换至gpt-xxxx或者api2d-xxxx。如果中文效果不理想, 尝试Prompt。正在处理中 ....."))
57
  yield from update_ui(chatbot=chatbot, history=history) # 刷新界面 # 由于请求gpt需要一段时间,我们先及时地做一次界面更新
58
+ if ("advanced_arg" in plugin_kwargs) and (plugin_kwargs["advanced_arg"] == ""): plugin_kwargs.pop("advanced_arg")
59
  resolution = plugin_kwargs.get("advanced_arg", '256x256')
60
  image_url, image_path = gen_image(llm_kwargs, prompt, resolution)
61
  chatbot.append([prompt,
crazy_functions/解析JupyterNotebook.py CHANGED
@@ -67,6 +67,7 @@ def parseNotebook(filename, enable_markdown=1):
67
  def ipynb解释(file_manifest, project_folder, llm_kwargs, plugin_kwargs, chatbot, history, system_prompt):
68
  from .crazy_utils import request_gpt_model_multi_threads_with_very_awesome_ui_and_high_efficiency
69
 
 
70
  enable_markdown = plugin_kwargs.get("advanced_arg", "1")
71
  try:
72
  enable_markdown = int(enable_markdown)
 
67
  def ipynb解释(file_manifest, project_folder, llm_kwargs, plugin_kwargs, chatbot, history, system_prompt):
68
  from .crazy_utils import request_gpt_model_multi_threads_with_very_awesome_ui_and_high_efficiency
69
 
70
+ if ("advanced_arg" in plugin_kwargs) and (plugin_kwargs["advanced_arg"] == ""): plugin_kwargs.pop("advanced_arg")
71
  enable_markdown = plugin_kwargs.get("advanced_arg", "1")
72
  try:
73
  enable_markdown = int(enable_markdown)
crazy_functions/询问多个大语言模型.py CHANGED
@@ -45,6 +45,7 @@ def 同时问询_指定模型(txt, llm_kwargs, plugin_kwargs, chatbot, history,
45
  chatbot.append((txt, "正在同时咨询ChatGPT和ChatGLM……"))
46
  yield from update_ui(chatbot=chatbot, history=history) # 刷新界面 # 由于请求gpt需要一段时间,我们先及时地做一次界面更新
47
 
 
48
  # llm_kwargs['llm_model'] = 'chatglm&gpt-3.5-turbo&api2d-gpt-3.5-turbo' # 支持任意数量的llm接口,用&符号分隔
49
  llm_kwargs['llm_model'] = plugin_kwargs.get("advanced_arg", 'chatglm&gpt-3.5-turbo') # 'chatglm&gpt-3.5-turbo' # 支持任意数量的llm接口,用&符号分隔
50
  gpt_say = yield from request_gpt_model_in_new_thread_with_ui_alive(
 
45
  chatbot.append((txt, "正在同时咨询ChatGPT和ChatGLM……"))
46
  yield from update_ui(chatbot=chatbot, history=history) # 刷新界面 # 由于请求gpt需要一段时间,我们先及时地做一次界面更新
47
 
48
+ if ("advanced_arg" in plugin_kwargs) and (plugin_kwargs["advanced_arg"] == ""): plugin_kwargs.pop("advanced_arg")
49
  # llm_kwargs['llm_model'] = 'chatglm&gpt-3.5-turbo&api2d-gpt-3.5-turbo' # 支持任意数量的llm接口,用&符号分隔
50
  llm_kwargs['llm_model'] = plugin_kwargs.get("advanced_arg", 'chatglm&gpt-3.5-turbo') # 'chatglm&gpt-3.5-turbo' # 支持任意数量的llm接口,用&符号分隔
51
  gpt_say = yield from request_gpt_model_in_new_thread_with_ui_alive(