Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files
app.py
CHANGED
|
@@ -9,7 +9,9 @@ from flask import Flask, request, jsonify # For creating the Flask API
|
|
| 9 |
superkart_api = Flask("superkart_api") #Complete the code to define the name of the app
|
| 10 |
|
| 11 |
# Load the trained churn prediction model
|
| 12 |
-
model = joblib.load("
|
|
|
|
|
|
|
| 13 |
|
| 14 |
# Define a route for the home page
|
| 15 |
@superkart_api.get('/')
|
|
@@ -45,8 +47,6 @@ def predict_sales():
|
|
| 45 |
# Return the prediction as a JSON response
|
| 46 |
return jsonify({'Sales': prediction})
|
| 47 |
|
| 48 |
-
# Adding a comment to force a file change detection - this is a test
|
| 49 |
-
# You can remove this comment later if the upload works
|
| 50 |
|
| 51 |
# Run the Flask app in debug mode
|
| 52 |
if __name__ == '__main__':
|
|
|
|
| 9 |
superkart_api = Flask("superkart_api") #Complete the code to define the name of the app
|
| 10 |
|
| 11 |
# Load the trained churn prediction model
|
| 12 |
+
model = joblib.load("/app/random_forest.joblib") #Corrected path for loading the model
|
| 13 |
+
# Adding a comment to force a file change detection - this is a test
|
| 14 |
+
# You can remove this comment later if the upload works
|
| 15 |
|
| 16 |
# Define a route for the home page
|
| 17 |
@superkart_api.get('/')
|
|
|
|
| 47 |
# Return the prediction as a JSON response
|
| 48 |
return jsonify({'Sales': prediction})
|
| 49 |
|
|
|
|
|
|
|
| 50 |
|
| 51 |
# Run the Flask app in debug mode
|
| 52 |
if __name__ == '__main__':
|