Kunal commited on
Commit
a190902
·
1 Parent(s): 32d0314

fixed problem with UI

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -47,7 +47,7 @@ def process_pdf_ui(file):
47
  return pdf_text
48
 
49
  def chat_ui(query, history, pdf_text):
50
- response = agent.chat(
51
  f"PDF Context: {pdf_text}\nUser Query: {query}\nChat History: {history}"
52
  )
53
  return response, history + [(query, response)]
@@ -59,7 +59,7 @@ with gr.Blocks() as demo:
59
  pdf_input = gr.File(label="Upload PDF", file_types=[".pdf"])
60
  pdf_text = gr.Textbox(visible=False)
61
 
62
- chatbot = gr.Chatbot()
63
  msg = gr.Textbox(placeholder="Ask a question about the PDF")
64
 
65
  pdf_input.upload(process_pdf_ui, inputs=pdf_input, outputs=pdf_text)
 
47
  return pdf_text
48
 
49
  def chat_ui(query, history, pdf_text):
50
+ response = agent.run(
51
  f"PDF Context: {pdf_text}\nUser Query: {query}\nChat History: {history}"
52
  )
53
  return response, history + [(query, response)]
 
59
  pdf_input = gr.File(label="Upload PDF", file_types=[".pdf"])
60
  pdf_text = gr.Textbox(visible=False)
61
 
62
+ chatbot = gr.Chatbot(type="messages")
63
  msg = gr.Textbox(placeholder="Ask a question about the PDF")
64
 
65
  pdf_input.upload(process_pdf_ui, inputs=pdf_input, outputs=pdf_text)