Spaces:
Running
Running
fixed package issue in dockerfile
Browse files- .huggingface.yml +2 -0
- Dockerfile +4 -16
- requirements.txt +2 -1
.huggingface.yml
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
build:
|
| 2 |
+
docker: true
|
Dockerfile
CHANGED
|
@@ -1,9 +1,7 @@
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
|
| 3 |
-
# Set working directory
|
| 4 |
WORKDIR /app
|
| 5 |
|
| 6 |
-
# Install system dependencies
|
| 7 |
RUN apt-get update && apt-get install -y \
|
| 8 |
git \
|
| 9 |
git-lfs \
|
|
@@ -16,25 +14,15 @@ RUN apt-get update && apt-get install -y \
|
|
| 16 |
&& rm -rf /var/lib/apt/lists/* \
|
| 17 |
&& git lfs install
|
| 18 |
|
| 19 |
-
# Copy requirements first for better caching
|
| 20 |
COPY requirements.txt .
|
| 21 |
-
|
| 22 |
-
# Install Python dependencies
|
| 23 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 24 |
|
| 25 |
-
# Copy application files
|
| 26 |
COPY . .
|
| 27 |
|
| 28 |
-
# Create necessary directories
|
| 29 |
RUN mkdir -p checkpoints uploads
|
| 30 |
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
RUN test -f checkpoints/model.pth && echo "model.pth found" || echo "model.pth missing"
|
| 35 |
-
|
| 36 |
-
# Expose the port Flask runs on
|
| 37 |
-
EXPOSE 5000
|
| 38 |
|
| 39 |
-
#
|
| 40 |
-
CMD ["python", "app.py"]
|
|
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
|
|
|
|
| 3 |
WORKDIR /app
|
| 4 |
|
|
|
|
| 5 |
RUN apt-get update && apt-get install -y \
|
| 6 |
git \
|
| 7 |
git-lfs \
|
|
|
|
| 14 |
&& rm -rf /var/lib/apt/lists/* \
|
| 15 |
&& git lfs install
|
| 16 |
|
|
|
|
| 17 |
COPY requirements.txt .
|
|
|
|
|
|
|
| 18 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 19 |
|
|
|
|
| 20 |
COPY . .
|
| 21 |
|
|
|
|
| 22 |
RUN mkdir -p checkpoints uploads
|
| 23 |
|
| 24 |
+
RUN ls -la checkpoints/ || echo "Checkpoints directory not found" && \
|
| 25 |
+
test -f checkpoints/efficientnet.onnx && echo "efficientnet.onnx found" || echo "efficientnet.onnx missing" && \
|
| 26 |
+
test -f checkpoints/model.pth && echo "model.pth found" || echo "model.pth missing"
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
|
| 28 |
+
# No EXPOSE or CMD — Hugging Face runs `python app.py` for Gradio automatically
|
|
|
requirements.txt
CHANGED
|
@@ -9,4 +9,5 @@ albumentations
|
|
| 9 |
opencv-python
|
| 10 |
torchsummary
|
| 11 |
onnx
|
| 12 |
-
onnx2pytorch
|
|
|
|
|
|
| 9 |
opencv-python
|
| 10 |
torchsummary
|
| 11 |
onnx
|
| 12 |
+
onnx2pytorch
|
| 13 |
+
gradio
|