Spaces:
Runtime error
Runtime error
Fix Dockerfile and include model
Browse files- Dockerfile +4 -6
- app.py +2 -4
Dockerfile
CHANGED
|
@@ -1,13 +1,11 @@
|
|
| 1 |
FROM python:3.9-slim
|
| 2 |
|
| 3 |
-
# Set the working directory inside the container
|
| 4 |
WORKDIR /app
|
| 5 |
|
| 6 |
-
|
| 7 |
-
COPY . .
|
| 8 |
-
|
| 9 |
-
# Install dependencies from the requirements file without using cache to reduce image size
|
| 10 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 11 |
|
| 12 |
-
|
|
|
|
|
|
|
| 13 |
CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:7860", "app:app"]
|
|
|
|
| 1 |
FROM python:3.9-slim
|
| 2 |
|
|
|
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
+
COPY requirements.txt .
|
|
|
|
|
|
|
|
|
|
| 6 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 7 |
|
| 8 |
+
COPY app.py .
|
| 9 |
+
COPY deployment_files/ ./deployment_files/
|
| 10 |
+
|
| 11 |
CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:7860", "app:app"]
|
app.py
CHANGED
|
@@ -7,11 +7,9 @@ from waitress import serve # ✅ Import waitress
|
|
| 7 |
app = Flask("Quarterly_Sales_Revenue_Predictor")
|
| 8 |
|
| 9 |
# Load model and data once at startup
|
|
|
|
| 10 |
|
| 11 |
-
|
| 12 |
-
#model = joblib.load("deployment_files/quarterly_sales_prediction_model_v1_0.joblib")
|
| 13 |
-
df = pd.read_csv("/content/drive/MyDrive/SuperKart.csv")
|
| 14 |
-
#df = pd.read_csv("deployment_files/SuperKart.csv")
|
| 15 |
# Update as needed
|
| 16 |
|
| 17 |
# Define feature columns
|
|
|
|
| 7 |
app = Flask("Quarterly_Sales_Revenue_Predictor")
|
| 8 |
|
| 9 |
# Load model and data once at startup
|
| 10 |
+
model = joblib.load("deployment_files/quarterly_sales_prediction_model_v1_0.joblib")
|
| 11 |
|
| 12 |
+
df = pd.read_csv("deployment_files/SuperKart.csv")
|
|
|
|
|
|
|
|
|
|
| 13 |
# Update as needed
|
| 14 |
|
| 15 |
# Define feature columns
|