Spaces:
Running
on
Zero
Running
on
Zero
tori29umai
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -570,7 +570,7 @@ def save_and_download_chat_log(chat_history):
|
|
570 |
if assistant_message:
|
571 |
writer.writerow(["assistant", assistant_message])
|
572 |
|
573 |
-
return
|
574 |
|
575 |
def resume_chat_from_log(chat_history):
|
576 |
# チャットボットのUIを更新
|
@@ -714,10 +714,14 @@ def build_gradio_interface():
|
|
714 |
with gr.Row():
|
715 |
download_log_button = gr.Button("チャットログをダウンロード")
|
716 |
|
717 |
-
download_log_output = gr.File(label="ダウンロード")
|
|
|
|
|
|
|
|
|
718 |
|
719 |
download_log_button.click(
|
720 |
-
|
721 |
inputs=[chatbot],
|
722 |
outputs=[download_log_output]
|
723 |
)
|
|
|
570 |
if assistant_message:
|
571 |
writer.writerow(["assistant", assistant_message])
|
572 |
|
573 |
+
return (output.getvalue(), filename)
|
574 |
|
575 |
def resume_chat_from_log(chat_history):
|
576 |
# チャットボットのUIを更新
|
|
|
714 |
with gr.Row():
|
715 |
download_log_button = gr.Button("チャットログをダウンロード")
|
716 |
|
717 |
+
download_log_output = gr.File(label="ダウンロード", visible=False)
|
718 |
+
|
719 |
+
def update_download_output(chat_history):
|
720 |
+
content, filename = save_and_download_chat_log(chat_history)
|
721 |
+
return gr.File.update(value=content, visible=True, filename=filename)
|
722 |
|
723 |
download_log_button.click(
|
724 |
+
update_download_output,
|
725 |
inputs=[chatbot],
|
726 |
outputs=[download_log_output]
|
727 |
)
|