Spaces:
Sleeping
Sleeping
File size: 965 Bytes
f192d59 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | FROM python:3.11-slim
WORKDIR /app
# Install system deps
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
&& rm -rf /var/lib/apt/lists/*
# Install CPU-only PyTorch first (much smaller than full CUDA build)
RUN pip install --no-cache-dir \
torch==2.2.2+cpu \
torchvision==0.17.2+cpu \
--index-url https://download.pytorch.org/whl/cpu
# Install remaining dependencies
COPY requirements-deploy.txt .
RUN pip install --no-cache-dir -r requirements-deploy.txt
# Download model weights at build time from Hugging Face
RUN mkdir -p weights && \
curl -L -o weights/advanced_model_best.pth \
https://huggingface.co/Aredeksu/SensiNet-Mammography/resolve/main/advanced_model_best.pth
# Copy application code
COPY app/ app/
# Hugging Face Spaces expects port 7860
ENV MODEL_MODE=real \
MODEL_VERSION=sensinet-v1 \
PORT=7860
EXPOSE 7860
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
|