bhaskartripathi commited on
Commit
0c8df14
1 Parent(s): 015b642

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -0
app.py CHANGED
@@ -231,6 +231,15 @@ questions = [
231
  "what is the dependent variable in this study?",
232
  ]
233
 
 
 
 
 
 
 
 
 
 
234
  recommender = SemanticSearch()
235
 
236
  title = 'PDF GPT Turbo'
@@ -271,6 +280,7 @@ with gr.Blocks(css="""#chatbot { font-size: 14px; min-height: 1200; }""") as dem
271
  with gr.Group():
272
  #chatbot = gr.Chatbot(placeholder="Chat History", label="Chat History", lines=20, elem_id="chatbot")
273
  chatbot = gr.Chatbot(placeholder="Chat History", label="Chat History", lines=50, elem_id="chatbot")
 
274
 
275
  # Bind the click event of the button to the question_answer function
276
  btn.click(
 
231
  "what is the dependent variable in this study?",
232
  ]
233
 
234
+ def clear_all(chat_history, url, file, question, model):
235
+ # Return default values for all fields
236
+ return [], '', None, '', 'gpt-3.5-turbo'
237
+ # Create a new button with the label "Clear"
238
+ clear_btn = gr.Button(value='Clear')
239
+ # Bind the click event of the "Clear" button to the clear_all function
240
+ clear_btn.click(clear_all,inputs=[chatbot, url, file, question, model],outputs=[chatbot, url, file, question, model],)
241
+
242
+
243
  recommender = SemanticSearch()
244
 
245
  title = 'PDF GPT Turbo'
 
280
  with gr.Group():
281
  #chatbot = gr.Chatbot(placeholder="Chat History", label="Chat History", lines=20, elem_id="chatbot")
282
  chatbot = gr.Chatbot(placeholder="Chat History", label="Chat History", lines=50, elem_id="chatbot")
283
+ clear_btn
284
 
285
  # Bind the click event of the button to the question_answer function
286
  btn.click(