Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -14,7 +14,7 @@ log_file_path = "logs/predictions.log"
|
|
14 |
# Configure logging to write to a log file
|
15 |
logging.basicConfig(
|
16 |
filename=log_file_path,
|
17 |
-
level=logging.
|
18 |
# format="%(asctime)s - ID: %(uuid)s - age: %age()s"
|
19 |
)
|
20 |
|
@@ -37,7 +37,7 @@ def predict_charges(i_age, i_sex, i_bmi, i_children, i_smoker, i_region):
|
|
37 |
prediction = model.predict(input_data)[0]
|
38 |
|
39 |
# Log the inputs and the prediction
|
40 |
-
logging.
|
41 |
f"ID: {uuid.uuid4()} | age: {i_age} | sex: {i_sex} | bmi: {i_bmi} | children: {i_children} | smoker: {i_smoker} | region: {i_region} | prediction: {prediction}"
|
42 |
)
|
43 |
|
|
|
14 |
# Configure logging to write to a log file
|
15 |
logging.basicConfig(
|
16 |
filename=log_file_path,
|
17 |
+
level=logging.WARNING,
|
18 |
# format="%(asctime)s - ID: %(uuid)s - age: %age()s"
|
19 |
)
|
20 |
|
|
|
37 |
prediction = model.predict(input_data)[0]
|
38 |
|
39 |
# Log the inputs and the prediction
|
40 |
+
logging.warning(
|
41 |
f"ID: {uuid.uuid4()} | age: {i_age} | sex: {i_sex} | bmi: {i_bmi} | children: {i_children} | smoker: {i_smoker} | region: {i_region} | prediction: {prediction}"
|
42 |
)
|
43 |
|