pradelf commited on
Commit
948a30d
·
verified ·
1 Parent(s): f2ff214

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -17
app.py CHANGED
@@ -111,28 +111,28 @@ async def predict(predictionFeatures: RentalFeatures):
111
  Prediction of car daily rental cost for a given properties of a car !
112
  """
113
  # Read data
114
- # pf = [
115
- # predictionFeatures.model_key or "Peugeot",
116
- # predictionFeatures.mileage or 0,
117
- # predictionFeatures.engine_power or 0,
118
- # predictionFeatures.fuel or "petrol",
119
- # predictionFeatures.car_type or "sedan",
120
- # predictionFeatures.private_parking_available or 1,
121
- # predictionFeatures.has_gps or 0,
122
- # predictionFeatures.has_air_conditioning or 0,
123
- # predictionFeatures.automatic_car or 0,
124
- # predictionFeatures.has_getaround_connect or 0,
125
- # predictionFeatures.has_speed_regulator or 0,
126
- # predictionFeatures.winter_tires or 0,
127
- # ]
128
-
129
- car_caracteristic = pd.DataFrame([predictionFeatures.model_dump()])
130
  logger.info('Started')
131
 
132
  logger.info(car_caracteristic)
133
  #car_caracteristic = pd.DataFrame({"Car": pf})
134
  # Log model from mlflow
135
- logged_model = "models:/getaround-price-prediction-model/versions/6" # REPLACE WITH YOUR OWN RUN ID
136
  #logged_model = "runs:/d3856ef1a2ee42db989496949f47ac74/getaround-price-prediction-model"
137
  # Load model as a PyFuncModel.
138
  loaded_model = mlflow.pyfunc.load_model(logged_model)
 
111
  Prediction of car daily rental cost for a given properties of a car !
112
  """
113
  # Read data
114
+ pf = [
115
+ predictionFeatures.model_key or "Peugeot",
116
+ predictionFeatures.mileage or 0,
117
+ predictionFeatures.engine_power or 0,
118
+ predictionFeatures.fuel or "petrol",
119
+ predictionFeatures.car_type or "sedan",
120
+ predictionFeatures.private_parking_available or 1,
121
+ predictionFeatures.has_gps or 0,
122
+ predictionFeatures.has_air_conditioning or 0,
123
+ predictionFeatures.automatic_car or 0,
124
+ predictionFeatures.has_getaround_connect or 0,
125
+ predictionFeatures.has_speed_regulator or 0,
126
+ predictionFeatures.winter_tires or 0,
127
+ ]
128
+
129
+ car_caracteristic = pd.DataFrame([pf])
130
  logger.info('Started')
131
 
132
  logger.info(car_caracteristic)
133
  #car_caracteristic = pd.DataFrame({"Car": pf})
134
  # Log model from mlflow
135
+ logged_model = "models:/getaround-price-prediction-model@champion" # REPLACE WITH YOUR OWN RUN ID
136
  #logged_model = "runs:/d3856ef1a2ee42db989496949f47ac74/getaround-price-prediction-model"
137
  # Load model as a PyFuncModel.
138
  loaded_model = mlflow.pyfunc.load_model(logged_model)