Spaces:
Runtime error
Runtime error
feat(jupter): use args to disable Markdown parse
Browse files
crazy_functional.py
CHANGED
@@ -30,6 +30,8 @@ def get_crazy_functions():
|
|
30 |
"Color": "stop",
|
31 |
"AsButton":False,
|
32 |
"Function": HotReload(解析ipynb文件),
|
|
|
|
|
33 |
},
|
34 |
"批量总结Word文档": {
|
35 |
"Color": "stop",
|
|
|
30 |
"Color": "stop",
|
31 |
"AsButton":False,
|
32 |
"Function": HotReload(解析ipynb文件),
|
33 |
+
"AdvancedArgs": True, # 调用时,唤起高级参数输入区(默认False)
|
34 |
+
"ArgsReminder": "若输入0,则不解析notebook中的Markdown块", # 高级参数输入区的显示提示
|
35 |
},
|
36 |
"批量总结Word文档": {
|
37 |
"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=
|
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 |
|