File tree Expand file tree Collapse file tree 1 file changed +21
-2
lines changed
qa/L0_backend_python/examples Expand file tree Collapse file tree 1 file changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -38,10 +38,29 @@ rm -fr *.log python_backend/
3838
3939# Install torch
4040pip3 uninstall -y torch
41+ pip3 uninstall -y numpy
42+ # NOTE: Using this subtest as a test case that involves using a python model with
43+ # numpy 2.X without changing the environments used in all the other test cases.
4144if [ " $TEST_JETSON " == " 0" ] && [[ ${TEST_WINDOWS} == 0 ]]; then
42- pip3 install torch==2.0.0+cu117 -f https://download.pytorch.org/whl/torch_stable.html torchvision==0.15.0+cu117
45+ if [ ${PYTHON_ENV_VERSION} == " 8" ]; then
46+ # Python 3.8 does not support numpy 2.x, so installing numpy1.x
47+ pip3 install " numpy<2"
48+ pip3 install torch==2.0.0+cu117 -f https://download.pytorch.org/whl/torch_stable.html torchvision==0.15.0+cu117
49+ else
50+ # Python 3.9 >= supports numpy 2.x.
51+ pip3 install " numpy>=2"
52+ pip3 install torch==2.5.0 torchvision==0.20.0 --index-url https://download.pytorch.org/whl/cu124
53+ fi
4354else
44- pip3 install torch==2.0.0 -f https://download.pytorch.org/whl/torch_stable.html torchvision==0.15.0
55+ if [ ${PYTHON_ENV_VERSION} == " 8" ]; then
56+ # Python 3.8 does not support numpy 2.x, so installing numpy1.x
57+ pip3 install " numpy<2"
58+ pip3 install torch==2.0.0 -f https://download.pytorch.org/whl/torch_stable.html torchvision==0.15.0
59+ else
60+ # Python 3.9 >= supports numpy 2.x.
61+ pip3 install " numpy>=2"
62+ pip3 install torch==2.5.0 -f https://download.pytorch.org/whl/torch_stable.html torchvision==0.20.0
63+ fi
4564fi
4665
4766# Install `validators` for Model Instance Kind example
You can’t perform that action at this time.
0 commit comments