Upload folder using huggingface_hub
Browse files
app.py
CHANGED
|
@@ -52,10 +52,10 @@ def predict_sales():
|
|
| 52 |
input_data = pd.DataFrame([sample])
|
| 53 |
|
| 54 |
# Make prediction (get log_price)
|
| 55 |
-
|
| 56 |
|
| 57 |
# Return the prediction
|
| 58 |
-
return jsonify({'Sales':
|
| 59 |
except Exception as e:
|
| 60 |
print(f"Error in prediction: {e}")
|
| 61 |
return jsonify({'error': str(e)})
|
|
|
|
| 52 |
input_data = pd.DataFrame([sample])
|
| 53 |
|
| 54 |
# Make prediction (get log_price)
|
| 55 |
+
sales_prediction = xgb_model.predict(input_data)[0]
|
| 56 |
|
| 57 |
# Return the prediction
|
| 58 |
+
return jsonify({'Sales': sales_prediction.tolist()})
|
| 59 |
except Exception as e:
|
| 60 |
print(f"Error in prediction: {e}")
|
| 61 |
return jsonify({'error': str(e)})
|