Yoxas commited on
Commit
411ec57
·
verified ·
1 Parent(s): 033c434

Update src/app.py

Browse files
Files changed (1) hide show
  1. src/app.py +3 -1
src/app.py CHANGED
@@ -21,8 +21,10 @@ with demo:
21
  submit_button.click(pdf_chatbot.add_text, inputs=[chat_history, txt], outputs=[chat_history], queue=False).\
22
  success(pdf_chatbot.generate_response, inputs=[chat_history, txt, uploaded_pdf,slider_chunk_size,slider_overlap_percentage,slider_temp,slider_k], outputs=[chat_history,txt]).\
23
  success(pdf_chatbot.render_file, inputs=[uploaded_pdf], outputs=[show_img])
 
24
  download_button = gr.Button("Download Chat History")
25
- download_button.click(fn=download_chat_history, inputs=[chat_history], outputs="file")
 
26
 
27
  if __name__ == "__main__":
28
  demo.launch()
 
21
  submit_button.click(pdf_chatbot.add_text, inputs=[chat_history, txt], outputs=[chat_history], queue=False).\
22
  success(pdf_chatbot.generate_response, inputs=[chat_history, txt, uploaded_pdf,slider_chunk_size,slider_overlap_percentage,slider_temp,slider_k], outputs=[chat_history,txt]).\
23
  success(pdf_chatbot.render_file, inputs=[uploaded_pdf], outputs=[show_img])
24
+
25
  download_button = gr.Button("Download Chat History")
26
+ download_output = gr.outputs.File("chat_history.csv")
27
+ download_button.click(fn=download_chat_history, inputs=[chat_history], outputs=download_output)
28
 
29
  if __name__ == "__main__":
30
  demo.launch()