Spaces:
Sleeping
Sleeping
fix(docker): resolve GroundingDINO build and NumPy runtime errors
Browse files- Dockerfile +12 -4
Dockerfile
CHANGED
|
@@ -118,13 +118,21 @@ RUN git clone https://github.com/luca-medeiros/lang-segment-anything /tmp/lang-s
|
|
| 118 |
git checkout 9bdf77715fa70fca96452184abdc64a6666e0d46 && \
|
| 119 |
pip install --no-deps -e .
|
| 120 |
|
| 121 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 122 |
RUN python -c "import groundingdino; print('groundingdino ok')"
|
| 123 |
RUN python -c "import lang_sam; print('lang_sam ok')"
|
| 124 |
|
| 125 |
-
# Upgrade pip and install Gradio
|
| 126 |
-
RUN python3 -m pip install --no-cache-dir gradio==6.13.0 accelerate==1.0.1
|
| 127 |
-
|
| 128 |
# Copy the app.py file from the host to the container
|
| 129 |
COPY --chown=user:user app.py .
|
| 130 |
|
|
|
|
| 118 |
git checkout 9bdf77715fa70fca96452184abdc64a6666e0d46 && \
|
| 119 |
pip install --no-deps -e .
|
| 120 |
|
| 121 |
+
# Install Gradio and accelerate
|
| 122 |
+
RUN python3 -m pip install --no-cache-dir gradio==6.13.0 accelerate==1.0.1
|
| 123 |
+
|
| 124 |
+
# Optional: avoids hot-reload warning on Spaces
|
| 125 |
+
RUN pip install --no-cache-dir spaces
|
| 126 |
+
|
| 127 |
+
# Critical fix: keep NumPy on 1.x for torch/torchvision compatibility
|
| 128 |
+
RUN pip install --no-cache-dir --force-reinstall "numpy<2"
|
| 129 |
+
|
| 130 |
+
# Sanity checks
|
| 131 |
+
RUN python -c "import numpy; print('numpy version:', numpy.__version__)"
|
| 132 |
+
RUN python -c "import torch; import numpy; print('torch ok / numpy ok')"
|
| 133 |
RUN python -c "import groundingdino; print('groundingdino ok')"
|
| 134 |
RUN python -c "import lang_sam; print('lang_sam ok')"
|
| 135 |
|
|
|
|
|
|
|
|
|
|
| 136 |
# Copy the app.py file from the host to the container
|
| 137 |
COPY --chown=user:user app.py .
|
| 138 |
|