Skip to content

Commit cbcbe02

Browse files
committed
build(install): uv sync --extra={cpu,cu118,...} instead of install_torch
1 parent 9d61bc5 commit cbcbe02

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

scripts/install_uv.sh

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,19 @@ mkdir -p ${MODELS_WEIGHT_DIR}
7979

8080

8181
main () {
82-
uv sync
82+
if [ "${CPU}" == "True" ]; then
83+
BUILD_SUFFIX="cpu"
84+
else
85+
detect_cuda_version
86+
BUILD_SUFFIX="cu${CUDA_VERSION//./}"
87+
fi
88+
89+
uv sync --extra="${BUILD_SUFFIX}"
8390

8491
uv pip install -U pip wheel
8592

86-
install_torch
93+
# No longer needed.
94+
# install_torch
8795

8896
for model in detectron2 jde yolox mmpose; do
8997
if [[ ",${MODEL,,}," == *",${model},"* ]] || [[ ",${MODEL,,}," == *",all,"* ]]; then
@@ -103,9 +111,9 @@ main () {
103111
uv pip install -e "${SCRIPT_DIR}/.."
104112

105113
echo
106-
echo "uv sync --inexact --dry-run (check for differences from uv.lock)"
114+
echo "uv sync --extra=${BUILD_SUFFIX} --inexact --dry-run (check for differences from uv.lock)"
107115
echo
108-
uv sync --inexact --dry-run
116+
uv sync --extra="${BUILD_SUFFIX}" --inexact --dry-run
109117

110118
if [ "${DOWNLOAD_WEIGHTS}" == "True" ]; then
111119
download_weights

0 commit comments

Comments
 (0)