Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -271,19 +271,19 @@ with gr.Blocks(
|
|
| 271 |
|
| 272 |
|
| 273 |
#with gr.Blocks() as demo:
|
| 274 |
-
|
| 275 |
-
|
| 276 |
-
|
| 277 |
-
|
| 278 |
|
| 279 |
-
|
| 280 |
-
|
| 281 |
-
|
| 282 |
-
|
| 283 |
-
|
| 284 |
-
|
| 285 |
-
|
| 286 |
-
|
| 287 |
|
| 288 |
#launching chatbot
|
| 289 |
demo.launch()
|
|
|
|
| 271 |
|
| 272 |
|
| 273 |
#with gr.Blocks() as demo:
|
| 274 |
+
chatbot = gr.Chatbot()
|
| 275 |
+
username_input = gr.Textbox(label="Username")
|
| 276 |
+
save_button = gr.Button("Save Chat History")
|
| 277 |
+
download_button = gr.File(label="Download Chat History", visible=False)
|
| 278 |
|
| 279 |
+
save_button.click(
|
| 280 |
+
fn=save_chat_history,
|
| 281 |
+
inputs=[chatbot, username_input],
|
| 282 |
+
outputs=download_button
|
| 283 |
+
).then(
|
| 284 |
+
fn=lambda: gr.update(visible=True),
|
| 285 |
+
outputs=download_button
|
| 286 |
+
)
|
| 287 |
|
| 288 |
#launching chatbot
|
| 289 |
demo.launch()
|