Spaces:
Runtime error
Runtime error
mrhblfx
commited on
Commit
•
11e33ec
1
Parent(s):
d192672
Reduced one input box
Browse files
main.py
CHANGED
@@ -85,13 +85,9 @@ with gr.Blocks(title="ChatGPT 学术优化", theme=set_theme, analytics_enabled=
|
|
85 |
crazy_fns[k]["Button"].style(size="sm")
|
86 |
with gr.Row():
|
87 |
with gr.Accordion("解析任意code项目", open=True):
|
88 |
-
gr.Markdown("
|
89 |
with gr.Row():
|
90 |
-
gr.
|
91 |
-
txt_pattern_include = gr.Textbox(show_label=False, placeholder="例如: .c .cpp .py").style(container=False)
|
92 |
-
with gr.Row():
|
93 |
-
gr.Markdown("将要忽略匹配文件的后缀")
|
94 |
-
txt_pattern_except = gr.Textbox(show_label=False, placeholder="例如: .png, .jpg wav flac").style(container=False)
|
95 |
code_plugin_name = "解析任意code项目"
|
96 |
variant = crazy_fns[code_plugin_name]["Color"] if "Color" in crazy_fns[code_plugin_name] else "secondary"
|
97 |
crazy_fns[code_plugin_name]["Button"] = gr.Button(code_plugin_name, variant=variant)
|
@@ -132,8 +128,7 @@ with gr.Blocks(title="ChatGPT 学术优化", theme=set_theme, analytics_enabled=
|
|
132 |
return ret
|
133 |
checkboxes.select(fn_area_visibility, [checkboxes], [area_basic_fn, area_crazy_fn, area_input_primary, area_input_secondary, txt, txt2] )
|
134 |
# 整理反复出现的控件句柄组合
|
135 |
-
|
136 |
-
input_combo = [cookies, txt, txt2, top_p, temperature, chatbot, history, system_prompt, *add_input_combo]
|
137 |
output_combo = [cookies, chatbot, history, status]
|
138 |
predict_args = dict(fn=ArgsGeneralWrapper(predict), inputs=input_combo, outputs=output_combo)
|
139 |
# 提交按钮、重置按钮
|
|
|
85 |
crazy_fns[k]["Button"].style(size="sm")
|
86 |
with gr.Row():
|
87 |
with gr.Accordion("解析任意code项目", open=True):
|
88 |
+
gr.Markdown("输入时用逗号隔开, `*`代表通配符, 加了`^`代表不匹配<br>例如: `*.c, ^*.cpp, config.toml, ^README.md`")
|
89 |
with gr.Row():
|
90 |
+
txt_pattern = gr.Textbox(show_label=False, placeholder="输入框为空则代表匹配所有文件").style(container=False)
|
|
|
|
|
|
|
|
|
91 |
code_plugin_name = "解析任意code项目"
|
92 |
variant = crazy_fns[code_plugin_name]["Color"] if "Color" in crazy_fns[code_plugin_name] else "secondary"
|
93 |
crazy_fns[code_plugin_name]["Button"] = gr.Button(code_plugin_name, variant=variant)
|
|
|
128 |
return ret
|
129 |
checkboxes.select(fn_area_visibility, [checkboxes], [area_basic_fn, area_crazy_fn, area_input_primary, area_input_secondary, txt, txt2] )
|
130 |
# 整理反复出现的控件句柄组合
|
131 |
+
input_combo = [cookies, txt, txt2, top_p, temperature, chatbot, history, system_prompt, txt_pattern]
|
|
|
132 |
output_combo = [cookies, chatbot, history, status]
|
133 |
predict_args = dict(fn=ArgsGeneralWrapper(predict), inputs=input_combo, outputs=output_combo)
|
134 |
# 提交按钮、重置按钮
|