manoj1hcl commited on
Commit
3394cd2
·
verified ·
1 Parent(s): 65c53a0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -93,7 +93,7 @@ def ask_question(message, history):
93
  except Exception as e:
94
  answer = f"Error:{str(e)}"
95
  history.append((message, answer))
96
- return history, history
97
  # Building Gradio Interface
98
  with gr.Blocks() as demo:
99
  gr.Markdown("## Chat with your pdf!!")
@@ -110,7 +110,7 @@ with gr.Blocks() as demo:
110
 
111
  file_input.change(upload_pdf, inputs=[file_input], outputs=[status])
112
  msg.submit(ask_question, [msg, state], [chatbot, state])
113
- clear.click(lambda: ([],[]), None, [chatbot, state])
114
  chain = None # global QA chain
115
 
116
  # Launch the app
 
93
  except Exception as e:
94
  answer = f"Error:{str(e)}"
95
  history.append((message, answer))
96
+ return history, history, ""
97
  # Building Gradio Interface
98
  with gr.Blocks() as demo:
99
  gr.Markdown("## Chat with your pdf!!")
 
110
 
111
  file_input.change(upload_pdf, inputs=[file_input], outputs=[status])
112
  msg.submit(ask_question, [msg, state], [chatbot, state])
113
+ clear.click(lambda: ([],[]), None, [chatbot, state, msg])
114
  chain = None # global QA chain
115
 
116
  # Launch the app