Shreyas094 commited on
Commit
47bf3b8
·
verified ·
1 Parent(s): 495c1d2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -8
app.py CHANGED
@@ -167,7 +167,8 @@ def chatbot_interface(message, history, use_web_search):
167
  main_content, sources = get_response_from_pdf(message)
168
 
169
  formatted_response = f"{main_content}\n\nSources:\n{sources}"
170
- return formatted_response
 
171
 
172
  # Gradio interface
173
  with gr.Blocks() as demo:
@@ -181,13 +182,11 @@ with gr.Blocks() as demo:
181
  update_output = gr.Textbox(label="Update Status")
182
  update_button.click(update_vectors, inputs=[file_input, parser_dropdown], outputs=update_output)
183
 
184
- with gr.Row():
185
- chatbot = gr.Chatbot(label="Conversation")
186
- with gr.Column():
187
- msg = gr.Textbox(label="Ask a question")
188
- use_web_search = gr.Checkbox(label="Use Web Search", value=False)
189
- submit = gr.Button("Submit")
190
-
191
  gr.Examples(
192
  examples=[
193
  ["What are the latest developments in AI?"],
 
167
  main_content, sources = get_response_from_pdf(message)
168
 
169
  formatted_response = f"{main_content}\n\nSources:\n{sources}"
170
+ history.append((message, formatted_response))
171
+ return history
172
 
173
  # Gradio interface
174
  with gr.Blocks() as demo:
 
182
  update_output = gr.Textbox(label="Update Status")
183
  update_button.click(update_vectors, inputs=[file_input, parser_dropdown], outputs=update_output)
184
 
185
+ chatbot = gr.Chatbot(label="Conversation")
186
+ msg = gr.Textbox(label="Ask a question")
187
+ use_web_search = gr.Checkbox(label="Use Web Search", value=False)
188
+ submit = gr.Button("Submit")
189
+
 
 
190
  gr.Examples(
191
  examples=[
192
  ["What are the latest developments in AI?"],