Spaces:
Sleeping
Sleeping
Brunwo commited on
Commit ·
a43dee5
1
Parent(s): fd02644
Add diffvg.pth to ensure pydiffvg is importable
Browse files- Dockerfile +5 -1
Dockerfile
CHANGED
|
@@ -40,7 +40,11 @@ RUN git clone --recursive https://github.com/BachiLi/diffvg.git /opt/diffvg && \
|
|
| 40 |
sed -i 's/if (frame && (std::string) str(frame->f_code->co_name)/if (0 \&\& (std::string) str(frame->f_code->co_name)/g' pybind11/include/pybind11/pybind11.h && \
|
| 41 |
sed -i 's/frame->f_code->co_argcount > 0) {/0) {/g' pybind11/include/pybind11/pybind11.h && \
|
| 42 |
sed -i 's/frame->f_locals, PyTuple_GET_ITEM(frame->f_code->co_varnames, 0));/nullptr/g' pybind11/include/pybind11/pybind11.h && \
|
| 43 |
-
python setup.py install
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
|
| 45 |
# Install wiregrad from source (Leimuhun/wiregrad - gradient/repulsion loss)
|
| 46 |
RUN pip install --no-cache-dir "git+https://github.com/Leimuhun/wiregrad.git"
|
|
|
|
| 40 |
sed -i 's/if (frame && (std::string) str(frame->f_code->co_name)/if (0 \&\& (std::string) str(frame->f_code->co_name)/g' pybind11/include/pybind11/pybind11.h && \
|
| 41 |
sed -i 's/frame->f_code->co_argcount > 0) {/0) {/g' pybind11/include/pybind11/pybind11.h && \
|
| 42 |
sed -i 's/frame->f_locals, PyTuple_GET_ITEM(frame->f_code->co_varnames, 0));/nullptr/g' pybind11/include/pybind11/pybind11.h && \
|
| 43 |
+
python setup.py install && \
|
| 44 |
+
# Ensure pydiffvg is importable - install to site-packages
|
| 45 |
+
python -c "import sys; print(sys.path)" && \
|
| 46 |
+
# Add diffvg to system path explicitly
|
| 47 |
+
echo "/opt/diffvg" >> /usr/local/lib/python3.12/site-packages/diffvg_path.pth
|
| 48 |
|
| 49 |
# Install wiregrad from source (Leimuhun/wiregrad - gradient/repulsion loss)
|
| 50 |
RUN pip install --no-cache-dir "git+https://github.com/Leimuhun/wiregrad.git"
|