DaniAcosta04 commited on
Commit
abf4101
·
verified ·
1 Parent(s): c9eaabd

Upload app.py

Browse files

Revised Gradio interface version

Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -56,13 +56,12 @@ def predict_charges(age, bmi, children, sex, smoker, region, prediction):
56
  with log_file.open("a") as f:
57
  f.write(json.dumps(
58
  {
59
- 'Region': region,
60
- 'Smoker': smoker,
61
  'BMI': bmi,
62
  'Children': children,
63
  'Sex': sex,
64
  'Smoker': smoker,
65
- 'Age': age,
66
  'Prediction': prediction[0]
67
  }
68
  ))
@@ -74,8 +73,8 @@ def predict_charges(age, bmi, children, sex, smoker, region, prediction):
74
  # Setting up UI components for input and output
75
  demo = gr.Interface(
76
  fn=predict_charges,
77
- inputs=[region_input, smoker_input, bmi_input,
78
- children_input, sex_input, age_input],
79
  outputs=model_output,
80
  title="HealthyLife Insurance Charge Prediction",
81
  description="This API allows you to predict the appropiate charges for each patient",
 
56
  with log_file.open("a") as f:
57
  f.write(json.dumps(
58
  {
59
+ 'Age': age,
 
60
  'BMI': bmi,
61
  'Children': children,
62
  'Sex': sex,
63
  'Smoker': smoker,
64
+ 'Region': region,
65
  'Prediction': prediction[0]
66
  }
67
  ))
 
73
  # Setting up UI components for input and output
74
  demo = gr.Interface(
75
  fn=predict_charges,
76
+ inputs=[age_input, bmi_input,
77
+ children_input, sex_input, smoker_input, region_input],
78
  outputs=model_output,
79
  title="HealthyLife Insurance Charge Prediction",
80
  description="This API allows you to predict the appropiate charges for each patient",