aks2022 commited on
Commit
0ac0954
·
verified ·
1 Parent(s): 11f634e

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -51,11 +51,9 @@ def predict_sales():
51
  # Make prediction (get sales)
52
  predicted_sales = model.predict(input_data)[0]
53
 
54
- # # Convert predicted_price to Python float
55
- # predicted_sales = round(float(predicted_sales), 2)
56
- # # The conversion above is needed as we convert the model prediction (log price) to actual price using np.exp, which returns predictions as NumPy float32 values.
57
- # # When we send this value directly within a JSON response, Flask's jsonify function encounters a datatype error
58
-
59
  # Return the actual price
60
  return jsonify({'Predicted Sales Forecast (in dollars)': predicted_sales})
61
 
 
51
  # Make prediction (get sales)
52
  predicted_sales = model.predict(input_data)[0]
53
 
54
+ # Convert to Python float and round
55
+ predicted_sales = round(float(predicted_sales), 2)
56
+
 
 
57
  # Return the actual price
58
  return jsonify({'Predicted Sales Forecast (in dollars)': predicted_sales})
59