Spaces:
Runtime error
Runtime error
change to docker
Browse filesFiles changed (2)
- DockerfileAdded+39
- requirements.txt-12
123456789101112131415161718192021222324252627282930313233343536373839# Stable combo: CUDA 11.8 + Torch 2.2.2 + Detectron2 prebuilt cu118 wheelsFROM nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu22.04
# System deps for rasterio/geopandas and build toolsRUN apt-get update && apt-get install -y \ python3 python3-pip python3-dev \ gdal-bin libgdal-dev \ libgl1 ffmpeg \ && rm -rf /var/lib/apt/lists/*
WORKDIR /appRUN python3 -m pip install --upgrade pip
# --- Install PyTorch FIRST (CUDA 11.8 wheels)RUN pip install --no-cache-dir --extra-index-url https://download.pytorch.org/whl/cu118 \ torch==2.2.2+cu118 torchvision==0.17.2+cu118
# --- Detectron2 from PREBUILT wheels for torch 2.2 + cu118 (no compile)RUN pip install --no-cache-dir -f \ https://dl.fbaipublicfiles.com/detectron2/wheels/cu118/torch2.2/index.html \ detectron2==0.6
# --- App deps (everything EXCEPT torch/detectron2)# Keep torch/detectron2 OUT of requirements.txt to avoid re-installCOPY requirements.txt /app/requirements.txtRUN sed -i '/torch/d;/detectron2/d' /app/requirements.txt && \ pip install --no-cache-dir -r /app/requirements.txt
# --- App codeCOPY . /app
# Gradio envs (HF respects these)ENV GRADIO_SERVER_NAME=0.0.0.0ENV GRADIO_SERVER_PORT=7860
# (Optional) Quick print of versions at container start for debugging# RUN python -c "import torch; print('Torch:', torch.__version__, 'CUDA:', torch.version.cuda)"
CMD ["python3", "app.py"]11232 unmodified lines67810111213141516171819209# --- core libsgradio>=4huggingface_hubnumpy2 unmodified linesrasteriogeopandasshapely
# --- install PyTorch FIRST (CUDA 11.8 wheels)--extra-index-url https://download.pytorch.org/whl/cu118torch==2.2.2+cu118torchvision==0.17.2+cu118
# --- Detectron2 PREBUILT wheel matching torch 2.2 + cu118 (no compiling)-f https://dl.fbaipublicfiles.com/detectron2/wheels/cu118/torch2.2/index.htmldetectron2==0.6
# --- Detectree2 AFTER detectron2git+https://github.com/PatBall1/detectree2.gitDockerfileAdded+39
requirements.txt-12