Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
@@ -60,6 +60,10 @@ async def predict_income(data: IncomePredictionRequest):
|
|
60 |
prediction_result = "Income over $50K" if prediction[0] == 1 else "Income under $50K"
|
61 |
return {"income_prediction": prediction_result, "prediction_probability": prediction_proba[0][1]}
|
62 |
|
|
|
|
|
|
|
|
|
63 |
if __name__ == "__main__":
|
64 |
import uvicorn
|
65 |
uvicorn.run(app, host="0.0.0.0", port=7860)
|
|
|
60 |
prediction_result = "Income over $50K" if prediction[0] == 1 else "Income under $50K"
|
61 |
return {"income_prediction": prediction_result, "prediction_probability": prediction_proba[0][1]}
|
62 |
|
63 |
+
except Exception as e:
|
64 |
+
logging.error(f"Prediction failed: {e}")
|
65 |
+
raise
|
66 |
+
|
67 |
if __name__ == "__main__":
|
68 |
import uvicorn
|
69 |
uvicorn.run(app, host="0.0.0.0", port=7860)
|