kcelia commited on
Commit
e0195cb
1 Parent(s): 2d600e9

chore: update

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -165,7 +165,7 @@ def get_user_symptoms_from_default_disease(disease):
165
  return pretty_print(columns_with_1)
166
 
167
 
168
- def get_user_symptoms_vector(selected_default_disease, *selected_symptoms):
169
 
170
  if any(lst for lst in selected_symptoms if lst) and (
171
  selected_default_disease is not None and len(selected_default_disease) > 0
@@ -211,7 +211,7 @@ def get_user_symptoms_vector(selected_default_disease, *selected_symptoms):
211
  }
212
 
213
 
214
- def clear_all_buttons():
215
  return {
216
  user_id_textbox: None,
217
  eval_key_textbox: None,
@@ -230,6 +230,10 @@ if __name__ == "__main__":
230
 
231
  valid_columns = X_train.columns.to_list()
232
 
 
 
 
 
233
  with gr.Blocks() as demo:
234
 
235
  # Link + images
@@ -301,14 +305,10 @@ if __name__ == "__main__":
301
  # Click submit botton
302
 
303
  submit_button.click(
304
- fn=get_user_symptoms_vector,
305
  inputs=[box_default, *check_boxes],
306
  outputs=[user_vector_textbox, error_box, *check_boxes],
307
  )
308
- # Load the model
309
- concrete_classifier = load(
310
- open("ConcreteXGBoostClassifier.pkl", "r", encoding="utf-8")
311
- )
312
 
313
  gr.Markdown("# Step 2: Generate the keys")
314
  gr.Markdown("Client side")
@@ -341,7 +341,7 @@ if __name__ == "__main__":
341
  gen_key.click(key_gen, outputs=[eval_key_textbox, user_id_textbox, eval_key_len_textbox])
342
 
343
  clear_button.click(
344
- clear_all_buttons,
345
  outputs=[
346
  user_id_textbox,
347
  user_vector_textbox,
 
165
  return pretty_print(columns_with_1)
166
 
167
 
168
+ def get_user_symptoms_vector_btn(selected_default_disease, *selected_symptoms):
169
 
170
  if any(lst for lst in selected_symptoms if lst) and (
171
  selected_default_disease is not None and len(selected_default_disease) > 0
 
211
  }
212
 
213
 
214
+ def clear_all_btn():
215
  return {
216
  user_id_textbox: None,
217
  eval_key_textbox: None,
 
230
 
231
  valid_columns = X_train.columns.to_list()
232
 
233
+ # Load the model
234
+ with open("ConcreteXGBoostClassifier.pkl", "r", encoding="utf-8") as file:
235
+ concrete_classifier = load(file)
236
+
237
  with gr.Blocks() as demo:
238
 
239
  # Link + images
 
305
  # Click submit botton
306
 
307
  submit_button.click(
308
+ fn=get_user_symptoms_vector_btn,
309
  inputs=[box_default, *check_boxes],
310
  outputs=[user_vector_textbox, error_box, *check_boxes],
311
  )
 
 
 
 
312
 
313
  gr.Markdown("# Step 2: Generate the keys")
314
  gr.Markdown("Client side")
 
341
  gen_key.click(key_gen, outputs=[eval_key_textbox, user_id_textbox, eval_key_len_textbox])
342
 
343
  clear_button.click(
344
+ clear_all_btn,
345
  outputs=[
346
  user_id_textbox,
347
  user_vector_textbox,