Spaces:
Build error
Build error
Update Dockerfile
Browse files- Dockerfile +13 -5
Dockerfile
CHANGED
|
@@ -28,7 +28,7 @@ USER user
|
|
| 28 |
|
| 29 |
ENV HOME=/home/user \
|
| 30 |
PATH=/home/user/.local/bin:$PATH \
|
| 31 |
-
PYTHONPATH=$HOME/app
|
| 32 |
PYTHONUNBUFFERED=1 \
|
| 33 |
GRADIO_ALLOW_FLAGGING=never \
|
| 34 |
GRADIO_NUM_PORTS=1 \
|
|
@@ -79,11 +79,22 @@ RUN if [ ! -f "$HOME/app/third_party/CSD/checkpoint.pth" ]; then \
|
|
| 79 |
echo "CSD checkpoint file not found" && exit 1; \
|
| 80 |
fi
|
| 81 |
|
| 82 |
-
RUN ls -
|
| 83 |
|
| 84 |
# Ensure CSD is a proper Python package
|
| 85 |
RUN touch $HOME/app/third_party/CSD/__init__.py
|
| 86 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 87 |
# Install LangSAM and its dependencies
|
| 88 |
RUN pip install --no-cache-dir git+https://github.com/IDEA-Research/GroundingDINO.git && \
|
| 89 |
pip install --no-cache-dir segment-anything==1.0 && \
|
|
@@ -95,9 +106,6 @@ RUN pip install --no-cache-dir git+https://github.com/IDEA-Research/GroundingDIN
|
|
| 95 |
# Upgrade pip and install Gradio
|
| 96 |
RUN python3 -m pip install --no-cache-dir gradio
|
| 97 |
|
| 98 |
-
# Verify CSD module can be imported
|
| 99 |
-
RUN python -c "import CSD; print('CSD module successfully imported')"
|
| 100 |
-
|
| 101 |
# Copy the app.py file from the host to the container
|
| 102 |
COPY --chown=user:user app.py .
|
| 103 |
|
|
|
|
| 28 |
|
| 29 |
ENV HOME=/home/user \
|
| 30 |
PATH=/home/user/.local/bin:$PATH \
|
| 31 |
+
PYTHONPATH=$HOME/app \
|
| 32 |
PYTHONUNBUFFERED=1 \
|
| 33 |
GRADIO_ALLOW_FLAGGING=never \
|
| 34 |
GRADIO_NUM_PORTS=1 \
|
|
|
|
| 79 |
echo "CSD checkpoint file not found" && exit 1; \
|
| 80 |
fi
|
| 81 |
|
| 82 |
+
RUN ls -la $HOME/app/third_party/CSD
|
| 83 |
|
| 84 |
# Ensure CSD is a proper Python package
|
| 85 |
RUN touch $HOME/app/third_party/CSD/__init__.py
|
| 86 |
|
| 87 |
+
# Update PYTHONPATH
|
| 88 |
+
ENV PYTHONPATH=$HOME/app:$HOME/app/third_party:$PYTHONPATH
|
| 89 |
+
|
| 90 |
+
# Print Python path
|
| 91 |
+
RUN python -c "import sys; print('\n'.join(sys.path))"
|
| 92 |
+
|
| 93 |
+
# Verify CSD module can be imported (try different methods)
|
| 94 |
+
RUN python -c "from third_party.CSD import model; print('CSD model successfully imported')" || \
|
| 95 |
+
python -c "import sys; sys.path.append('/home/user/app/third_party'); from CSD import model; print('CSD model successfully imported')"
|
| 96 |
+
|
| 97 |
+
|
| 98 |
# Install LangSAM and its dependencies
|
| 99 |
RUN pip install --no-cache-dir git+https://github.com/IDEA-Research/GroundingDINO.git && \
|
| 100 |
pip install --no-cache-dir segment-anything==1.0 && \
|
|
|
|
| 106 |
# Upgrade pip and install Gradio
|
| 107 |
RUN python3 -m pip install --no-cache-dir gradio
|
| 108 |
|
|
|
|
|
|
|
|
|
|
| 109 |
# Copy the app.py file from the host to the container
|
| 110 |
COPY --chown=user:user app.py .
|
| 111 |
|