Pavan178 commited on
Commit
184444b
·
verified ·
1 Parent(s): 697fdbe

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -85,7 +85,8 @@ def process_file(file):
85
 
86
  def chatbot(message, history):
87
  response = handle_query(message)
88
- return response
 
89
 
90
  # Gradio interface
91
  with gr.Blocks() as demo:
@@ -107,9 +108,7 @@ with gr.Blocks() as demo:
107
  msg = gr.Textbox(label="Ask me anything about the content of the PDF:")
108
  clear = gr.Button("Clear")
109
 
110
- msg.submit(chatbot, [msg, chatbot], [chatbot, msg]).then(
111
- lambda: gr.update(value=""), None, [msg], queue=False
112
- )
113
  clear.click(lambda: None, None, chatbot, queue=False)
114
 
115
  if __name__ == "__main__":
 
85
 
86
  def chatbot(message, history):
87
  response = handle_query(message)
88
+ history.append((message, response))
89
+ return history, ""
90
 
91
  # Gradio interface
92
  with gr.Blocks() as demo:
 
108
  msg = gr.Textbox(label="Ask me anything about the content of the PDF:")
109
  clear = gr.Button("Clear")
110
 
111
+ msg.submit(chatbot, [msg, chatbot], [chatbot, msg])
 
 
112
  clear.click(lambda: None, None, chatbot, queue=False)
113
 
114
  if __name__ == "__main__":