pradelf commited on
Commit
17940dc
·
verified ·
1 Parent(s): 0faec03

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -166,12 +166,14 @@ async def predict(predictionFeatures: RentalFeatures):
166
  # Conversion explicite des colonnes booléennes
167
  for col in BOOL_COLS:
168
  car_caracteristic[col] = car_caracteristic[col].astype(bool)
 
 
169
  # Prediction from previously loaded model as a PyFuncModel.
170
  prediction = model.predict(car_caracteristic)
171
-
172
  # Format response
173
  response = {
174
- "prediction": prediction.tolist()[0],
175
  "detail": "Prédiction du tarif journalier (nul si aucun modèle : model.pkl).",
176
  }
177
  return response
 
166
  # Conversion explicite des colonnes booléennes
167
  for col in BOOL_COLS:
168
  car_caracteristic[col] = car_caracteristic[col].astype(bool)
169
+ car_caracteristic=[car_caracteristic]
170
+ logger.info(f"Input : {car_caracteristic}")
171
  # Prediction from previously loaded model as a PyFuncModel.
172
  prediction = model.predict(car_caracteristic)
173
+ logger.info(f"Output : {prediction}")
174
  # Format response
175
  response = {
176
+ "prediction": prediction[0],
177
  "detail": "Prédiction du tarif journalier (nul si aucun modèle : model.pkl).",
178
  }
179
  return response