Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files- Dockerfile +2 -2
- app.py +2 -2
- extraalearn_model.joblib +2 -2
Dockerfile
CHANGED
|
@@ -11,6 +11,6 @@ RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
|
| 11 |
|
| 12 |
# Define the command to start the application using Gunicorn with 4 worker processes
|
| 13 |
# - `-w 4`: Uses 4 worker processes for handling requests
|
| 14 |
-
# - `-b 0.0.0.0:8501`: Binds the server to port
|
| 15 |
# - `app:app`: Runs the Flask app (assuming `app.py` contains the Flask instance named `app`)
|
| 16 |
-
CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:
|
|
|
|
| 11 |
|
| 12 |
# Define the command to start the application using Gunicorn with 4 worker processes
|
| 13 |
# - `-w 4`: Uses 4 worker processes for handling requests
|
| 14 |
+
# - `-b 0.0.0.0:8501`: Binds the server to port 7860 on all network interfaces
|
| 15 |
# - `app:app`: Runs the Flask app (assuming `app.py` contains the Flask instance named `app`)
|
| 16 |
+
CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:7860", "app:extraalearn_api"]
|
app.py
CHANGED
|
@@ -6,7 +6,7 @@ import pandas as pd # For data manipulation
|
|
| 6 |
from flask import Flask, request, jsonify # For creating the Flask API
|
| 7 |
|
| 8 |
# Initialize Flask app with a name
|
| 9 |
-
extraalearn_api = Flask("
|
| 10 |
|
| 11 |
# Load the trained churn prediction model
|
| 12 |
model = joblib.load("extraalearn_model.joblib")
|
|
@@ -43,7 +43,7 @@ def predict_sales():
|
|
| 43 |
input_data = pd.DataFrame([sample])
|
| 44 |
|
| 45 |
# Make a churn prediction using the trained model
|
| 46 |
-
prediction = model.predict(input_data)
|
| 47 |
|
| 48 |
# Return the prediction as a JSON response
|
| 49 |
return jsonify({'Sales': prediction})
|
|
|
|
| 6 |
from flask import Flask, request, jsonify # For creating the Flask API
|
| 7 |
|
| 8 |
# Initialize Flask app with a name
|
| 9 |
+
extraalearn_api = Flask("ExtraaLearn")
|
| 10 |
|
| 11 |
# Load the trained churn prediction model
|
| 12 |
model = joblib.load("extraalearn_model.joblib")
|
|
|
|
| 43 |
input_data = pd.DataFrame([sample])
|
| 44 |
|
| 45 |
# Make a churn prediction using the trained model
|
| 46 |
+
prediction = model.predict(input_data)[0]
|
| 47 |
|
| 48 |
# Return the prediction as a JSON response
|
| 49 |
return jsonify({'Sales': prediction})
|
extraalearn_model.joblib
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f620d3af597296b0c8e1dad99342b3ea4b02c85bab53b96ebaf7379481405c83
|
| 3 |
+
size 316539
|