File tree Expand file tree Collapse file tree 1 file changed +39
-3
lines changed
qa/L0_backend_python/examples Expand file tree Collapse file tree 1 file changed +39
-3
lines changed Original file line number Diff line number Diff line change @@ -37,13 +37,16 @@ SERVER_LOG="./inference_server.log"
3737RET=0
3838rm -fr * .log python_backend/
3939
40- # Install torch
41- # Skip torch install on Jetson since it is already installed.
40+ # Install torch
41+ # Skip torch and torchvision install on Jetson since it is already installed.
4242if [ " $TEST_JETSON " == " 0" ]; then
4343 pip3 uninstall -y torch
44- pip3 install torch==1.13.0+cu117 -f https://download.pytorch.org/whl/torch_stable.html
44+ pip3 install torch==1.13.0+cu117 -f https://download.pytorch.org/whl/torch_stable.html torchvision==0.14.0+cu117
4545fi
4646
47+ # Install `validators` for Model Instance Kind example
48+ pip3 install validators
49+
4750# Install JAX
4851if [ " $TEST_JETSON " == " 0" ]; then
4952 pip3 install --upgrade " jax[cuda]" -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html
@@ -378,6 +381,39 @@ if [ "$TEST_JETSON" == "0" ]; then
378381 wait $SERVER_PID
379382fi
380383
384+ # Example 7
385+
386+ # Model Instance Kind
387+ CLIENT_LOG=" ./model_instance_kind.log"
388+ mkdir -p models/resnet50/1
389+ cp examples/instance_kind/model.py models/resnet50/1/
390+ cp examples/instance_kind/config.pbtxt models/resnet50/
391+ run_server
392+ if [ " $SERVER_PID " == " 0" ]; then
393+ echo -e " \n***\n*** Failed to start $SERVER \n***"
394+ cat $SERVER_LOG
395+ RET=1
396+ fi
397+
398+ set +e
399+ python3 examples/instance_kind/client.py --label_file examples/instance_kind/resnet50_labels.txt > $CLIENT_LOG
400+ if [ $? -ne 0 ]; then
401+ echo -e " \n***\n*** Failed to verify Model instance Kind example. \n***"
402+ RET=1
403+ fi
404+
405+ grep " PASS" $CLIENT_LOG
406+ if [ $? -ne 0 ]; then
407+ echo -e " \n***\n*** Failed to verify Model Instance Kind example. Example failed to pass. \n***"
408+ cat $CLIENT_LOG
409+ RET=1
410+ fi
411+ set -e
412+
413+ kill $SERVER_PID
414+ wait $SERVER_PID
415+
416+
381417if [ $RET -eq 0 ]; then
382418 echo -e " \n***\n*** Example verification test PASSED.\n***"
383419else
You can’t perform that action at this time.
0 commit comments