Spaces:
Runtime error
Runtime error
Commit
·
f4e76cf
1
Parent(s):
05da51e
Update app_cn.py
Browse files
app_cn.py
CHANGED
@@ -129,22 +129,23 @@ with gradio.Blocks(title="ChatGPT 批处理", css=css) as demo:
|
|
129 |
# 中止执行按钮
|
130 |
stop_btn = gradio.Button(value='中止!')
|
131 |
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
|
|
148 |
|
149 |
|
150 |
start_event = start_btn.click(
|
|
|
129 |
# 中止执行按钮
|
130 |
stop_btn = gradio.Button(value='中止!')
|
131 |
|
132 |
+
with gradio.Accordion("下载聊天记录", open=False):
|
133 |
+
gradio.Markdown("(暂时无法下载,可能是 Hugging Face 的限制,之后更新)")
|
134 |
+
make_file_btn = gradio.Button(value='生成文件')
|
135 |
+
with gradio.Row(visible=False) as file_row:
|
136 |
+
# 下载区域(json文件)
|
137 |
+
history_file_json = gradio.File(label='Json 下载', interactive=False)
|
138 |
+
# 下载区域(md文件)
|
139 |
+
history_file_md = gradio.File(label='Markdown 下载', interactive=False)
|
140 |
+
pass
|
141 |
+
pass
|
142 |
+
|
143 |
+
|
144 |
+
make_file_btn.click(
|
145 |
+
fn=make_history_file_fn,
|
146 |
+
inputs=[history],
|
147 |
+
outputs=[history_file_json, history_file_md, file_row],
|
148 |
+
)
|
149 |
|
150 |
|
151 |
start_event = start_btn.click(
|