binary-husky commited on
Commit
0b89673
2 Parent(s): 2f4e050 13342c2

Merge pull request #571 from codycjy/notebook_args

Browse files
crazy_functional.py CHANGED
@@ -35,6 +35,8 @@ def get_crazy_functions():
35
  "Color": "stop",
36
  "AsButton":False,
37
  "Function": HotReload(解析ipynb文件),
 
 
38
  },
39
  "批量总结Word文档": {
40
  "Color": "stop",
 
35
  "Color": "stop",
36
  "AsButton":False,
37
  "Function": HotReload(解析ipynb文件),
38
+ "AdvancedArgs": True, # 调用时,唤起高级参数输入区(默认False)
39
+ "ArgsReminder": "若输入0,则不解析notebook中的Markdown块", # 高级参数输入区的显示提示
40
  },
41
  "批量总结Word文档": {
42
  "Color": "stop",
crazy_functions/解析JupyterNotebook.py CHANGED
@@ -67,11 +67,16 @@ 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
  pfg = PaperFileGroup()
71
 
72
- print(file_manifest)
73
  for fp in file_manifest:
74
- file_content = parseNotebook(fp, enable_markdown=1)
75
  pfg.file_paths.append(fp)
76
  pfg.file_contents.append(file_content)
77
 
 
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)
73
+ except ValueError:
74
+ enable_markdown = 1
75
+
76
  pfg = PaperFileGroup()
77
 
 
78
  for fp in file_manifest:
79
+ file_content = parseNotebook(fp, enable_markdown=enable_markdown)
80
  pfg.file_paths.append(fp)
81
  pfg.file_contents.append(file_content)
82