Update app.py
Browse files
app.py
CHANGED
|
@@ -54,18 +54,18 @@ def dprocess(age, bmi, children, sex, smoker, region):
|
|
| 54 |
|
| 55 |
#Index(['age', 'sex', 'bmi', 'children', 'smoker', 'region'], dtype='object')
|
| 56 |
|
| 57 |
-
sample = {
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
}
|
| 65 |
-
|
| 66 |
-
data_point = pd.DataFrame([sample])
|
| 67 |
|
| 68 |
-
prediction = insurance_charge_predictor.predict(data_point).tolist()
|
| 69 |
|
| 70 |
with scheduler.lock:
|
| 71 |
with log_file.open("a") as f:
|
|
@@ -82,7 +82,8 @@ def dprocess(age, bmi, children, sex, smoker, region):
|
|
| 82 |
))
|
| 83 |
f.write("\n")
|
| 84 |
|
| 85 |
-
return prediction[0]
|
|
|
|
| 86 |
|
| 87 |
# Set-up the Gradio UI
|
| 88 |
textbox = gr.Textbox(label='Command:')
|
|
@@ -100,4 +101,4 @@ demo = gr.Interface(fn=dprocess,
|
|
| 100 |
theme=gr.themes.Soft())
|
| 101 |
|
| 102 |
demo.queue()
|
| 103 |
-
demo.launch()
|
|
|
|
| 54 |
|
| 55 |
#Index(['age', 'sex', 'bmi', 'children', 'smoker', 'region'], dtype='object')
|
| 56 |
|
| 57 |
+
# sample = {
|
| 58 |
+
# 'age': age,
|
| 59 |
+
# 'sex': sex,
|
| 60 |
+
# 'bmi': bmi,
|
| 61 |
+
# 'children': children,
|
| 62 |
+
# 'smoker': smoker,
|
| 63 |
+
# 'region': region
|
| 64 |
+
# }
|
| 65 |
+
|
| 66 |
+
# data_point = pd.DataFrame([sample])
|
| 67 |
|
| 68 |
+
# prediction = insurance_charge_predictor.predict(data_point).tolist()
|
| 69 |
|
| 70 |
with scheduler.lock:
|
| 71 |
with log_file.open("a") as f:
|
|
|
|
| 82 |
))
|
| 83 |
f.write("\n")
|
| 84 |
|
| 85 |
+
#return prediction[0]
|
| 86 |
+
return 42
|
| 87 |
|
| 88 |
# Set-up the Gradio UI
|
| 89 |
textbox = gr.Textbox(label='Command:')
|
|
|
|
| 101 |
theme=gr.themes.Soft())
|
| 102 |
|
| 103 |
demo.queue()
|
| 104 |
+
demo.launch()
|