Manglik-R commited on
Commit
1c17feb
1 Parent(s): fdf4f16

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -66,14 +66,14 @@ with gr.Blocks(css=css) as demo:
66
 
67
  with gr.Column():
68
  pdf_doc = gr.File(label="Load a pdf", file_types=['.pdf'], type="file")
69
- with gr.Row():
70
- langchain_status = gr.Textbox(label="Status", placeholder="", interactive=False)
71
- load_pdf = gr.Button("Load pdf to langchain")
72
-
73
  chatbot = gr.Chatbot([], elem_id="chatbot").style(height=350)
74
  question = gr.Textbox(label="Question", placeholder="Type your question and hit Enter ")
75
  submit_btn = gr.Button("Send message")
76
  #load_pdf.click(loading_pdf, None, langchain_status, queue=False)
 
77
  load_pdf.click(pdf_changes, inputs=[pdf_doc], outputs=[langchain_status], queue=False)
78
  question.submit(add_text, [chatbot, question], [chatbot, question]).then(
79
  bot, chatbot, chatbot
 
66
 
67
  with gr.Column():
68
  pdf_doc = gr.File(label="Load a pdf", file_types=['.pdf'], type="file")
69
+ langchain_status = gr.Textbox(label="Status", placeholder="", interactive=False)
70
+ load_pdf = gr.Button("Load PDF")
71
+ Book = gr.Dropdown(label="Books", choices=["Book 1", "Book 2", "Book 3"], value=["Book 1", "Book 2", "Book 3"])
 
72
  chatbot = gr.Chatbot([], elem_id="chatbot").style(height=350)
73
  question = gr.Textbox(label="Question", placeholder="Type your question and hit Enter ")
74
  submit_btn = gr.Button("Send message")
75
  #load_pdf.click(loading_pdf, None, langchain_status, queue=False)
76
+ Book.change(pdf_changes, inputs=[Book], outputs=[langchain_status], queue=False)
77
  load_pdf.click(pdf_changes, inputs=[pdf_doc], outputs=[langchain_status], queue=False)
78
  question.submit(add_text, [chatbot, question], [chatbot, question]).then(
79
  bot, chatbot, chatbot