Upload folder using huggingface_hub
Browse files
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 |
-
#
|
| 55 |
-
|
| 56 |
-
|
| 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 |
|