Mohinikathro commited on
Commit
448110d
·
verified ·
1 Parent(s): dba1b37

changes made to app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -3
app.py CHANGED
@@ -199,7 +199,17 @@ def end_interview(state):
199
  return state["conversation"], state
200
 
201
  def clear_state():
202
- return [], None
 
 
 
 
 
 
 
 
 
 
203
 
204
  # ===============================
205
  # Gradio UI
@@ -233,6 +243,6 @@ with gr.Blocks() as demo:
233
  outputs=[chatbot, state])
234
  submit_button.click(submit_response, inputs=[response_input, state], outputs=[chatbot, state]).then(lambda: "", None, response_input)
235
  exit_button.click(end_interview, inputs=state, outputs=[chatbot, state])
236
- clear_button.click(lambda: ([], None), outputs=[chatbot, state])
237
 
238
- demo.launch()
 
199
  return state["conversation"], state
200
 
201
  def clear_state():
202
+ return [], {
203
+ "name": "",
204
+ "domain": "",
205
+ "company": "",
206
+ "level": "",
207
+ "asked_questions": set(),
208
+ "asked_subtopics": set(),
209
+ "conversation": [],
210
+ "evaluations": [],
211
+ "interview_active": False
212
+ }
213
 
214
  # ===============================
215
  # Gradio UI
 
243
  outputs=[chatbot, state])
244
  submit_button.click(submit_response, inputs=[response_input, state], outputs=[chatbot, state]).then(lambda: "", None, response_input)
245
  exit_button.click(end_interview, inputs=state, outputs=[chatbot, state])
246
+ clear_button.click(clear_state, outputs=[chatbot, state])
247
 
248
+ demo.launch(ssr=False)