Spaces:
Build error
Build error
Update setup_blender.sh
Browse files- setup_blender.sh +17 -2
setup_blender.sh
CHANGED
|
@@ -14,6 +14,10 @@ BLENDER_PY_EXEC="${INSTALL_DIR}/${BLENDER_MAJOR_MINOR}/python/bin/${BLENDER_PYTH
|
|
| 14 |
# Assuming unirig_requirements.txt is in the root directory alongside this script and app.py
|
| 15 |
# If UniRig repo is cloned first, adjust path e.g., "UniRig/unirig_requirements.txt"
|
| 16 |
UNIRIG_REQS_FILE="unirig_requirements.txt"
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
# --- Download and Extract Blender ---
|
| 19 |
echo "Downloading Blender ${BLENDER_VERSION}..."
|
|
@@ -48,8 +52,19 @@ fi
|
|
| 48 |
echo "Upgrading pip for Blender Python..."
|
| 49 |
"${BLENDER_PY_EXEC}" -m pip install --upgrade pip setuptools wheel
|
| 50 |
|
| 51 |
-
# Install
|
| 52 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
"${BLENDER_PY_EXEC}" -m pip install --no-cache-dir -r "${UNIRIG_REQS_FILE}"
|
| 54 |
|
| 55 |
echo "UniRig dependency installation for Blender Python complete."
|
|
|
|
| 14 |
# Assuming unirig_requirements.txt is in the root directory alongside this script and app.py
|
| 15 |
# If UniRig repo is cloned first, adjust path e.g., "UniRig/unirig_requirements.txt"
|
| 16 |
UNIRIG_REQS_FILE="unirig_requirements.txt"
|
| 17 |
+
# Define the specific torch version and index URL (matching unirig_requirements.txt)
|
| 18 |
+
TORCH_VERSION="2.3.1"
|
| 19 |
+
TORCHVISION_VERSION="0.18.1"
|
| 20 |
+
TORCH_INDEX_URL="https://download.pytorch.org/whl/cu121" # Make sure this matches your target CUDA
|
| 21 |
|
| 22 |
# --- Download and Extract Blender ---
|
| 23 |
echo "Downloading Blender ${BLENDER_VERSION}..."
|
|
|
|
| 52 |
echo "Upgrading pip for Blender Python..."
|
| 53 |
"${BLENDER_PY_EXEC}" -m pip install --upgrade pip setuptools wheel
|
| 54 |
|
| 55 |
+
# --- Install PyTorch and Torchvision FIRST ---
|
| 56 |
+
# This is crucial because some packages (like torch-scatter) need torch during their own setup
|
| 57 |
+
echo "Installing PyTorch ${TORCH_VERSION} and Torchvision ${TORCHVISION_VERSION} first..."
|
| 58 |
+
"${BLENDER_PY_EXEC}" -m pip install --no-cache-dir \
|
| 59 |
+
torch==${TORCH_VERSION} \
|
| 60 |
+
torchvision==${TORCHVISION_VERSION} \
|
| 61 |
+
--index-url ${TORCH_INDEX_URL}
|
| 62 |
+
|
| 63 |
+
echo "PyTorch and Torchvision installation complete."
|
| 64 |
+
|
| 65 |
+
# --- Install the rest of the packages from unirig_requirements.txt ---
|
| 66 |
+
# Pip will skip torch and torchvision if they are already installed at the correct version
|
| 67 |
+
echo "Installing remaining packages from ${UNIRIG_REQS_FILE}..."
|
| 68 |
"${BLENDER_PY_EXEC}" -m pip install --no-cache-dir -r "${UNIRIG_REQS_FILE}"
|
| 69 |
|
| 70 |
echo "UniRig dependency installation for Blender Python complete."
|