Spaces:
Build error
Build error
Update Dockerfile
Browse files- Dockerfile +23 -0
Dockerfile
CHANGED
|
@@ -108,6 +108,29 @@ RUN pip install --no-cache-dir git+https://github.com/IDEA-Research/GroundingDIN
|
|
| 108 |
pip install -e . && \
|
| 109 |
cd ..
|
| 110 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 111 |
# Upgrade pip and install Gradio
|
| 112 |
RUN python3 -m pip install --no-cache-dir gradio
|
| 113 |
|
|
|
|
| 108 |
pip install -e . && \
|
| 109 |
cd ..
|
| 110 |
|
| 111 |
+
# Create a custom setup.py for GroundingDINO extension
|
| 112 |
+
RUN echo "from setuptools import setup\n\
|
| 113 |
+
from torch.utils.cpp_extension import BuildExtension, CUDAExtension\n\
|
| 114 |
+
\n\
|
| 115 |
+
setup(\n\
|
| 116 |
+
name='groundingdino',\n\
|
| 117 |
+
ext_modules=[\n\
|
| 118 |
+
CUDAExtension(\n\
|
| 119 |
+
name='_C',\n\
|
| 120 |
+
sources=['/home/user/.local/lib/python3.10/site-packages/groundingdino/models/GroundingDINO/csrc/ms_deform_attn.cpp', '/home/user/.local/lib/python3.10/site-packages/groundingdino/models/GroundingDINO/csrc/ms_deform_attn_cuda.cu'],\n\
|
| 121 |
+
extra_compile_args={'cxx': ['-g'], 'nvcc': ['-O2', '-arch=sm_70']},\n\
|
| 122 |
+
),\n\
|
| 123 |
+
],\n\
|
| 124 |
+
cmdclass={\n\
|
| 125 |
+
'build_ext': BuildExtension\n\
|
| 126 |
+
}\n\
|
| 127 |
+
)" > /home/user/setup_groundingdino.py
|
| 128 |
+
|
| 129 |
+
# Compile the GroundingDINO custom C++ operations
|
| 130 |
+
RUN cd /home/user && \
|
| 131 |
+
python setup_groundingdino.py build_ext --inplace && \
|
| 132 |
+
rm setup_groundingdino.py
|
| 133 |
+
|
| 134 |
# Upgrade pip and install Gradio
|
| 135 |
RUN python3 -m pip install --no-cache-dir gradio
|
| 136 |
|