Janec09 commited on
Commit
b0527ae
·
verified ·
1 Parent(s): 445cde6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -8
app.py CHANGED
@@ -253,14 +253,21 @@ with gr.Blocks(
253
 
254
  return filename
255
 
256
- save_button.click(
257
- fn=save_chat_history,
258
- inputs=[gr.ChatInterface.chatbot],
259
- outputs=download_button
260
- ).then(
261
- lambda: gr.update(visible=True),
262
- outputs=download_button
263
- )
 
 
 
 
 
 
 
264
  #launching chatbot
265
  demo.launch()
266
 
 
253
 
254
  return filename
255
 
256
+ with gr.Blocks() as demo:
257
+ chatbot = gr.Chatbot()
258
+ username_input = gr.Textbox(label="Username")
259
+ save_button = gr.Button("Save Chat History")
260
+ download_button = gr.File(label="Download Chat History", visible=False)
261
+
262
+ save_button.click(
263
+ fn=save_chat_history,
264
+ inputs=[chatbot, username_input],
265
+ outputs=download_button
266
+ ).then(
267
+ fn=lambda: gr.update(visible=True),
268
+ outputs=download_button
269
+ )
270
+
271
  #launching chatbot
272
  demo.launch()
273