Spaces:
Sleeping
Sleeping
Clean deployment
Browse files- .gitattributes +1 -0
- .gitignore +26 -5
- dockerfile +20 -3
.gitattributes
CHANGED
|
@@ -1,2 +1,3 @@
|
|
| 1 |
*.h5 filter=lfs diff=lfs merge=lfs -text
|
| 2 |
artifacts/training/model/variables/variables.data-*-of-* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 1 |
*.h5 filter=lfs diff=lfs merge=lfs -text
|
| 2 |
artifacts/training/model/variables/variables.data-*-of-* filter=lfs diff=lfs merge=lfs -text
|
| 3 |
+
artifacts/training/best_model.h5 filter=lfs diff=lfs merge=lfs -text
|
.gitignore
CHANGED
|
@@ -206,10 +206,31 @@ marimo/_static/
|
|
| 206 |
marimo/_lsp/
|
| 207 |
__marimo__/
|
| 208 |
|
| 209 |
-
|
|
|
|
|
|
|
|
|
|
| 210 |
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
|
| 214 |
cnn_env/
|
| 215 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 206 |
marimo/_lsp/
|
| 207 |
__marimo__/
|
| 208 |
|
| 209 |
+
# Python
|
| 210 |
+
__pycache__/
|
| 211 |
+
*.pyc
|
| 212 |
+
*.egg-info
|
| 213 |
|
| 214 |
+
# Virtual Environments - DO NOT TRACK
|
| 215 |
+
venv/
|
| 216 |
+
new_venv/
|
| 217 |
cnn_env/
|
| 218 |
+
|
| 219 |
+
# MLOps - Local artifacts and temporary files
|
| 220 |
+
# These are generated by dvc repro and should NOT be in Git
|
| 221 |
+
.env
|
| 222 |
+
mlruns/
|
| 223 |
+
artifacts/
|
| 224 |
+
model/ # Ignore the experimental model folder
|
| 225 |
+
|
| 226 |
+
# Temporary files from app execution and debugging
|
| 227 |
+
inputImage.jpg
|
| 228 |
+
test_output.jpg
|
| 229 |
+
training_history.csv
|
| 230 |
+
confusion_matrix.png
|
| 231 |
+
scores.json
|
| 232 |
+
|
| 233 |
+
# IDE / OS specific
|
| 234 |
+
.vscode/
|
| 235 |
+
.idea/
|
| 236 |
+
*.DS_Store
|
dockerfile
CHANGED
|
@@ -1,7 +1,24 @@
|
|
| 1 |
-
FROM python:3.
|
| 2 |
WORKDIR /app
|
|
|
|
|
|
|
| 3 |
COPY requirements.txt .
|
| 4 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
EXPOSE 8080
|
| 7 |
-
CMD ["
|
|
|
|
| 1 |
+
FROM python:3.8-slim
|
| 2 |
WORKDIR /app
|
| 3 |
+
|
| 4 |
+
# Copy requirements first for caching
|
| 5 |
COPY requirements.txt .
|
| 6 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 7 |
+
|
| 8 |
+
# Copy all the essential application source code
|
| 9 |
+
COPY app.py .
|
| 10 |
+
COPY src ./src
|
| 11 |
+
COPY templates ./templates
|
| 12 |
+
COPY static ./static
|
| 13 |
+
COPY config ./config
|
| 14 |
+
COPY params.yaml .
|
| 15 |
+
# ... copy any other essential source files
|
| 16 |
+
|
| 17 |
+
# --- CRITICAL CHANGE ---
|
| 18 |
+
# Create a 'model' directory inside the container and
|
| 19 |
+
# copy ONLY our LFS-tracked model file into it.
|
| 20 |
+
RUN mkdir model
|
| 21 |
+
COPY artifacts/training/best_model.h5 ./model/
|
| 22 |
+
|
| 23 |
EXPOSE 8080
|
| 24 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8080"]
|