File size: 658 Bytes
77a3002
 
 
93cde06
77a3002
2cbd477
77a3002
158bad6
77a3002
 
d9640db
77a3002
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from interface import create_demo
from pdfchatbot import PDFChatBot

demo, chat_history, show_img, txt, submit_button, uploaded_pdf, slider1 = create_demo()

pdf_chatbot = PDFChatBot()
with demo:
    uploaded_pdf.upload(pdf_chatbot.render_file, inputs=[uploaded_pdf,slider1], outputs=[show_img])

    submit_button.click(pdf_chatbot.add_text, inputs=[chat_history, txt], outputs=[chat_history], queue=False).\
        success(pdf_chatbot.generate_response, inputs=[chat_history, txt, uploaded_pdf], outputs=[chat_history,txt]).\
        success(pdf_chatbot.render_file, inputs=[uploaded_pdf], outputs=[show_img])

if __name__ == "__main__":
    demo.launch()