Skip to content

Commit 94fce3c

Browse files
committed
[one-cmds] Skip default torch extra-index-url
This commit skips default torch option when ONE_PREPVENV_PIP_OPTION is set. ONE-DCO-1.0-Signed-off-by: seongwoo <mhs4670go@naver.com>
1 parent bf53cc8 commit 94fce3c

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

compiler/one-cmds/one-prepare-venv

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,16 @@ fi
9696

9797
# Install PyTorch and ONNX related
9898
# NOTE set ONE_PREPVENV_TORCH_SOURCE to override options for source URL.
99-
TORCH_SOURCE_OPTION="--extra-index-url https://download.pytorch.org/whl/cpu"
100-
if [[ ! -z "$ONE_PREPVENV_TORCH_SOURCE" ]]; then
99+
TORCH_SOURCE_OPTION=""
100+
if [[ -n "$ONE_PREPVENV_PIP_OPTION" ]]; then
101+
echo "ONE_PREPVENV_PIP_OPTION is set; skipping default torch source option."
102+
elif [[ -n "$ONE_PREPVENV_TORCH_SOURCE" ]]; then
101103
TORCH_SOURCE_OPTION="${ONE_PREPVENV_TORCH_SOURCE}"
104+
else
105+
TORCH_SOURCE_OPTION="--extra-index-url https://download.pytorch.org/whl/cpu"
102106
fi
103-
# TODO remove torch message
104-
echo "Torch from '${ONE_PREPVENV_TORCH_SOURCE}' -> '${TORCH_SOURCE_OPTION}'"
107+
108+
echo "Torch source option: '${TORCH_SOURCE_OPTION}'"
105109

106110
${VENV_PYTHON} -m pip ${PIP_OPTIONS} install --upgrade pip setuptools
107111

0 commit comments

Comments
 (0)