From 0152030a11e6d7b65fb6de322478309aeace70ed Mon Sep 17 00:00:00 2001 From: Sai Kiran Polisetty Date: Thu, 26 Jun 2025 19:34:57 +0530 Subject: [PATCH 01/10] Update --- .../classification_parameter_test.py | 95 +++++++++++++++++++ qa/L0_parameters/test.sh | 58 ++++++++++- src/classification.cc | 20 +++- 3 files changed, 167 insertions(+), 6 deletions(-) create mode 100644 qa/L0_parameters/classification_parameter_test.py diff --git a/qa/L0_parameters/classification_parameter_test.py b/qa/L0_parameters/classification_parameter_test.py new file mode 100644 index 0000000000..f227056373 --- /dev/null +++ b/qa/L0_parameters/classification_parameter_test.py @@ -0,0 +1,95 @@ +#!/usr/bin/env python3 + +# Copyright 2023-2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of NVIDIA CORPORATION nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import sys + +sys.path.append("../common") + +import os +import unittest +import test_util as tu +import numpy as np +import tritonclient.grpc as grpcclient +import tritonclient.http as httpclient +from tritonclient.utils import InferenceServerException + + +class ClassificationParameterTest(tu.TestResultCollector): + def setUp(self): + self.protocol = os.environ.get("CLIENT_TYPE", "http") + if self.protocol == "http": + self.client = httpclient.InferenceServerClient("localhost:8000") + else: + self.client = grpcclient.InferenceServerClient("localhost:8001") + + def _prepare_io(self, input_data, dtype): + if self.protocol == "http": + inputs = [httpclient.InferInput("INPUT0", input_data.shape, dtype)] + outputs = [httpclient.InferRequestedOutput(name="OUTPUT0", class_count=5)] + else: + inputs = [grpcclient.InferInput("INPUT0", input_data.shape, dtype)] + outputs = [grpcclient.InferRequestedOutput(name="OUTPUT0", class_count=5)] + inputs[0].set_data_from_numpy(input_data) + return inputs, outputs + + def test_classificattion(self): + shape = (1, 8) + dtype = "FP32" + model_name = "identity_fp32" + input_data = np.ones(shape, dtype=np.float32) + + inputs, outputs = self._prepare_io(input_data, dtype) + result = self.client.infer( + model_name=model_name, inputs=inputs, outputs=outputs + ) + output = result.get_output("OUTPUT0") + if self.protocol == "http": + output_dtype = output["datatype"] + else: + output_dtype = output.datatype + + self.assertEqual(output_dtype, "BYTES") + + def test_classificattion_incorrect_data_type(self): + shape = (1, 8) + model_name = "identity_bytes" + dtype = "BYTES" + input_data = np.array([["test"] * shape[1]], dtype=object) + + inputs, outputs = self._prepare_io(input_data, dtype) + with self.assertRaises(InferenceServerException) as e: + self.client.infer(model_name=model_name, inputs=inputs, outputs=outputs) + + self.assertIn( + "class result not available for output due to unsupported type 'BYTES'", + str(e.exception), + ) + + +if __name__ == "__main__": + unittest.main() diff --git a/qa/L0_parameters/test.sh b/qa/L0_parameters/test.sh index c53b02d4b7..e0d6c9484a 100755 --- a/qa/L0_parameters/test.sh +++ b/qa/L0_parameters/test.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2023-2024, NVIDIA CORPORATION. All rights reserved. +# Copyright 2023-2025, NVIDIA CORPORATION. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -97,10 +97,64 @@ for i in "${all_tests[@]}"; do wait $SERVER_PID done + +# Test Classification Extension +MODELDIR="models" +TEST_RESULT_FILE="test_results.txt" +TEST_SCRIPT_PY="./classification_parameter_test.py" + +rm -rf $MODELDIR +mkdir -p "${MODELDIR}/identity_fp32/1" +cp ../python_models/identity_fp32/config.pbtxt "${MODELDIR}/identity_fp32/" +cp ../python_models/identity_fp32/model.py "${MODELDIR}/identity_fp32/1/" + +mkdir -p "${MODELDIR}/identity_bytes/1" +cp ../python_models/identity_fp32/config.pbtxt "${MODELDIR}/identity_bytes/" +cp ../python_models/identity_fp32/model.py "${MODELDIR}/identity_bytes/1/" +(cd "${MODELDIR}/identity_bytes" && \ + sed -i 's/identity_fp32/identity_bytes/' config.pbtxt && \ + sed -i 's/TYPE_FP32/TYPE_STRING/' config.pbtxt ) + +SERVER_ARGS="--model-repository=`pwd`/${MODELDIR} --log-verbose=1" +for client_type in http grpc; do + export CLIENT_TYPE=$client_type + SERVER_LOG="./classification_param_${client_type}_test_server.log" + CLIENT_LOG="./classification_param_${client_type}_test_client.log" + rm -f $SERVER_LOG $CLIENT_LOG + run_server + if [ "$SERVER_PID" == "0" ]; then + echo -e "\n***\n*** Failed to start $SERVER\n***" + cat $SERVER_LOG + exit 1 + fi + + set +e + python3 $TEST_SCRIPT_PY -v >>"$CLIENT_LOG" 2>&1 + if [ $? -ne 0 ]; then + cat $CLIENT_LOG + echo -e "\n***\n*** Test Failed - classification_param_${client_type}_test_client\n***" + RET=1 + else + check_test_results $TEST_RESULT_FILE 2 + if [ $? -ne 0 ]; then + cat $TEST_RESULT_FILE + echo -e "\n***\n*** Test Result Verification Failed - classification_param_${client_type}_test_client\n***" + RET=1 + fi + fi + kill $SERVER_PID + wait $SERVER_PID + + if [ $? -ne 0 ]; then + echo -e "\n***\n*** Test Server shut down non-gracefully\n***" + RET=1 + fi + set -e +done + if [ $RET -eq 0 ]; then echo -e "\n***\n*** Test Passed\n***" else - cat $CLIENT_LOG echo -e "\n***\n*** Test FAILED\n***" fi diff --git a/src/classification.cc b/src/classification.cc index 2d8cd26b9e..c75e764a7f 100644 --- a/src/classification.cc +++ b/src/classification.cc @@ -77,8 +77,19 @@ TopkClassifications( const TRITONSERVER_DataType datatype, const uint32_t req_class_count, std::vector* class_strs) { - const size_t element_cnt = - byte_size / TRITONSERVER_DataTypeByteSize(datatype); + const uint32_t dtype_byte_size = TRITONSERVER_DataTypeByteSize(datatype); + if (dtype_byte_size == 0) { + return TRITONSERVER_ErrorNew( + TRITONSERVER_ERROR_INVALID_ARG, + std::string( + std::string( + "class result not available for output due to " + "unsupported type '") + + std::string(TRITONSERVER_DataTypeString(datatype)) + "'") + .c_str()); + } + + const size_t element_cnt = byte_size / dtype_byte_size; switch (datatype) { case TRITONSERVER_TYPE_UINT8: @@ -118,8 +129,9 @@ TopkClassifications( return TRITONSERVER_ErrorNew( TRITONSERVER_ERROR_INVALID_ARG, std::string( - std::string("class result not available for output due to " - "unsupported type '") + + std::string( + "class result not available for output due to " + "unsupported type '") + std::string(TRITONSERVER_DataTypeString(datatype)) + "'") .c_str()); } From 34e212ccb043e5ac6beffeb58a4b8d16e7be45fc Mon Sep 17 00:00:00 2001 From: Sai Kiran Polisetty Date: Thu, 26 Jun 2025 14:09:55 +0000 Subject: [PATCH 02/10] Update --- qa/L0_parameters/classification_parameter_test.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) mode change 100644 => 100755 qa/L0_parameters/classification_parameter_test.py diff --git a/qa/L0_parameters/classification_parameter_test.py b/qa/L0_parameters/classification_parameter_test.py old mode 100644 new mode 100755 index f227056373..9565fa0b0a --- a/qa/L0_parameters/classification_parameter_test.py +++ b/qa/L0_parameters/classification_parameter_test.py @@ -32,8 +32,9 @@ import os import unittest -import test_util as tu + import numpy as np +import test_util as tu import tritonclient.grpc as grpcclient import tritonclient.http as httpclient from tritonclient.utils import InferenceServerException From 4c27d94bfc8dc3e51b8d52f6c1241c9f5376dd04 Mon Sep 17 00:00:00 2001 From: Sai Kiran Polisetty Date: Thu, 26 Jun 2025 19:43:26 +0530 Subject: [PATCH 03/10] Update --- qa/L0_parameters/classification_parameter_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qa/L0_parameters/classification_parameter_test.py b/qa/L0_parameters/classification_parameter_test.py index 9565fa0b0a..6a5ef1d3a6 100755 --- a/qa/L0_parameters/classification_parameter_test.py +++ b/qa/L0_parameters/classification_parameter_test.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -# Copyright 2023-2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# Copyright 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions From 891fecf7f1d37802e0efaa325b4c5871422ace32 Mon Sep 17 00:00:00 2001 From: Sai Kiran Polisetty Date: Thu, 26 Jun 2025 19:44:41 +0530 Subject: [PATCH 04/10] Update --- qa/L0_parameters/classification_parameter_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qa/L0_parameters/classification_parameter_test.py b/qa/L0_parameters/classification_parameter_test.py index 6a5ef1d3a6..6ace566965 100755 --- a/qa/L0_parameters/classification_parameter_test.py +++ b/qa/L0_parameters/classification_parameter_test.py @@ -76,7 +76,7 @@ def test_classificattion(self): self.assertEqual(output_dtype, "BYTES") - def test_classificattion_incorrect_data_type(self): + def test_classificattion_unsupported_data_type(self): shape = (1, 8) model_name = "identity_bytes" dtype = "BYTES" From d9e5c70147f1e873c2e574309ef25fbae7767257 Mon Sep 17 00:00:00 2001 From: Sai Kiran Polisetty Date: Thu, 26 Jun 2025 20:29:23 +0530 Subject: [PATCH 05/10] Update --- ...ification_parameter_test.py => class_count_test.py} | 9 +++++++++ qa/L0_parameters/test.sh | 10 +++++----- 2 files changed, 14 insertions(+), 5 deletions(-) rename qa/L0_parameters/{classification_parameter_test.py => class_count_test.py} (90%) mode change 100755 => 100644 diff --git a/qa/L0_parameters/classification_parameter_test.py b/qa/L0_parameters/class_count_test.py old mode 100755 new mode 100644 similarity index 90% rename from qa/L0_parameters/classification_parameter_test.py rename to qa/L0_parameters/class_count_test.py index 6ace566965..9e49ae4ae2 --- a/qa/L0_parameters/classification_parameter_test.py +++ b/qa/L0_parameters/class_count_test.py @@ -76,6 +76,15 @@ def test_classificattion(self): self.assertEqual(output_dtype, "BYTES") + # Validate shape matches to the class_count + output_data = result.as_numpy("OUTPUT0") + self.assertIsNotNone(output_data) + self.assertEqual(output_data.shape, (1, 5)) + + for res_str_bytes in np.nditer(output_data, flags=["refs_ok"]): + res_str = res_str_bytes.item().decode("utf-8") + self.assertTrue(res_str.startswith("1.000000:")) + def test_classificattion_unsupported_data_type(self): shape = (1, 8) model_name = "identity_bytes" diff --git a/qa/L0_parameters/test.sh b/qa/L0_parameters/test.sh index e0d6c9484a..d8ad843ec2 100755 --- a/qa/L0_parameters/test.sh +++ b/qa/L0_parameters/test.sh @@ -101,7 +101,7 @@ done # Test Classification Extension MODELDIR="models" TEST_RESULT_FILE="test_results.txt" -TEST_SCRIPT_PY="./classification_parameter_test.py" +TEST_SCRIPT_PY="./class_count_test.py" rm -rf $MODELDIR mkdir -p "${MODELDIR}/identity_fp32/1" @@ -118,8 +118,8 @@ cp ../python_models/identity_fp32/model.py "${MODELDIR}/identity_bytes/1/" SERVER_ARGS="--model-repository=`pwd`/${MODELDIR} --log-verbose=1" for client_type in http grpc; do export CLIENT_TYPE=$client_type - SERVER_LOG="./classification_param_${client_type}_test_server.log" - CLIENT_LOG="./classification_param_${client_type}_test_client.log" + SERVER_LOG="./class_count_test_${client_type}_server.log" + CLIENT_LOG="./class_count_test_${client_type}_client.log" rm -f $SERVER_LOG $CLIENT_LOG run_server if [ "$SERVER_PID" == "0" ]; then @@ -132,13 +132,13 @@ for client_type in http grpc; do python3 $TEST_SCRIPT_PY -v >>"$CLIENT_LOG" 2>&1 if [ $? -ne 0 ]; then cat $CLIENT_LOG - echo -e "\n***\n*** Test Failed - classification_param_${client_type}_test_client\n***" + echo -e "\n***\n*** Test Failed - class_count_${client_type}_test_client\n***" RET=1 else check_test_results $TEST_RESULT_FILE 2 if [ $? -ne 0 ]; then cat $TEST_RESULT_FILE - echo -e "\n***\n*** Test Result Verification Failed - classification_param_${client_type}_test_client\n***" + echo -e "\n***\n*** Test Result Verification Failed - class_count_${client_type}_test_client\n***" RET=1 fi fi From 33871a3432bb5cbc27cbf99faa28a20bfb697e78 Mon Sep 17 00:00:00 2001 From: Sai Kiran Polisetty Date: Thu, 26 Jun 2025 20:41:21 +0530 Subject: [PATCH 06/10] fix pre-commit errors --- src/classification.cc | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/classification.cc b/src/classification.cc index c75e764a7f..828edf613d 100644 --- a/src/classification.cc +++ b/src/classification.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. +// Copyright (c) 2020-2025, NVIDIA CORPORATION. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions @@ -82,9 +82,8 @@ TopkClassifications( return TRITONSERVER_ErrorNew( TRITONSERVER_ERROR_INVALID_ARG, std::string( - std::string( - "class result not available for output due to " - "unsupported type '") + + std::string("class result not available for output due to " + "unsupported type '") + std::string(TRITONSERVER_DataTypeString(datatype)) + "'") .c_str()); } @@ -129,9 +128,8 @@ TopkClassifications( return TRITONSERVER_ErrorNew( TRITONSERVER_ERROR_INVALID_ARG, std::string( - std::string( - "class result not available for output due to " - "unsupported type '") + + std::string("class result not available for output due to " + "unsupported type '") + std::string(TRITONSERVER_DataTypeString(datatype)) + "'") .c_str()); } From 54b7c45b1c88369ed8845ce1e27d5eb976b4f016 Mon Sep 17 00:00:00 2001 From: Sai Kiran Polisetty Date: Thu, 26 Jun 2025 15:13:50 +0000 Subject: [PATCH 07/10] fix pre-commit errors --- qa/L0_parameters/class_count_test.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 qa/L0_parameters/class_count_test.py diff --git a/qa/L0_parameters/class_count_test.py b/qa/L0_parameters/class_count_test.py old mode 100644 new mode 100755 From f31d463519cf4c58a420e7144bc741768a809461 Mon Sep 17 00:00:00 2001 From: Sai Kiran Polisetty Date: Fri, 27 Jun 2025 10:48:30 +0530 Subject: [PATCH 08/10] Update --- Dockerfile.QA | 4 ++++ qa/L0_parameters/test.sh | 9 ++------- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Dockerfile.QA b/Dockerfile.QA index d95b6cf9e2..4423ed9884 100644 --- a/Dockerfile.QA +++ b/Dockerfile.QA @@ -167,6 +167,10 @@ RUN mkdir -p qa/L0_simple_ensemble/models/simple/1 && \ cp docs/examples/model_repository/simple/1/model.onnx \ qa/L0_socket/models/simple/1/. +RUN mkdir -p qa/L0_parameters/models/identity_fp32/1 && \ + cp -r qa/python_models/identity_fp32/config.pbtxt qa/L0_parameters/models/identity_fp32/ && \ + cp -r qa/python_models/identity_fp32/model.py qa/L0_parameters/models/identity_fp32/1/ + RUN mkdir -p qa/L0_backend_identity/models && \ cp -r src/test/models/identity_fp32 qa/L0_backend_identity/models/. && \ mkdir -p qa/L0_backend_identity/models/identity_fp32/1 diff --git a/qa/L0_parameters/test.sh b/qa/L0_parameters/test.sh index d8ad843ec2..de25208de9 100755 --- a/qa/L0_parameters/test.sh +++ b/qa/L0_parameters/test.sh @@ -103,14 +103,9 @@ MODELDIR="models" TEST_RESULT_FILE="test_results.txt" TEST_SCRIPT_PY="./class_count_test.py" -rm -rf $MODELDIR -mkdir -p "${MODELDIR}/identity_fp32/1" -cp ../python_models/identity_fp32/config.pbtxt "${MODELDIR}/identity_fp32/" -cp ../python_models/identity_fp32/model.py "${MODELDIR}/identity_fp32/1/" - mkdir -p "${MODELDIR}/identity_bytes/1" -cp ../python_models/identity_fp32/config.pbtxt "${MODELDIR}/identity_bytes/" -cp ../python_models/identity_fp32/model.py "${MODELDIR}/identity_bytes/1/" +cp ${MODELDIR}/identity_fp32/config.pbtxt "${MODELDIR}/identity_bytes/" +cp ${MODELDIR}/identity_fp32/1/model.py "${MODELDIR}/identity_bytes/1/" (cd "${MODELDIR}/identity_bytes" && \ sed -i 's/identity_fp32/identity_bytes/' config.pbtxt && \ sed -i 's/TYPE_FP32/TYPE_STRING/' config.pbtxt ) From 2503b0ec0889a92febfe7100e609698f4a290e29 Mon Sep 17 00:00:00 2001 From: Sai Kiran Polisetty Date: Mon, 30 Jun 2025 23:09:36 +0530 Subject: [PATCH 09/10] Undo Dockerfile.QA modifications --- Dockerfile.QA | 4 ---- qa/L0_parameters/test.sh | 9 +++++++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Dockerfile.QA b/Dockerfile.QA index 4423ed9884..d95b6cf9e2 100644 --- a/Dockerfile.QA +++ b/Dockerfile.QA @@ -167,10 +167,6 @@ RUN mkdir -p qa/L0_simple_ensemble/models/simple/1 && \ cp docs/examples/model_repository/simple/1/model.onnx \ qa/L0_socket/models/simple/1/. -RUN mkdir -p qa/L0_parameters/models/identity_fp32/1 && \ - cp -r qa/python_models/identity_fp32/config.pbtxt qa/L0_parameters/models/identity_fp32/ && \ - cp -r qa/python_models/identity_fp32/model.py qa/L0_parameters/models/identity_fp32/1/ - RUN mkdir -p qa/L0_backend_identity/models && \ cp -r src/test/models/identity_fp32 qa/L0_backend_identity/models/. && \ mkdir -p qa/L0_backend_identity/models/identity_fp32/1 diff --git a/qa/L0_parameters/test.sh b/qa/L0_parameters/test.sh index de25208de9..3b7a6c8eba 100755 --- a/qa/L0_parameters/test.sh +++ b/qa/L0_parameters/test.sh @@ -103,9 +103,14 @@ MODELDIR="models" TEST_RESULT_FILE="test_results.txt" TEST_SCRIPT_PY="./class_count_test.py" +rm -rf $MODELDIR +mkdir -p "${MODELDIR}/identity_fp32/1" +cp /opt/tritonserver/qa/python_models/identity_fp32/config.pbtxt "${MODELDIR}/identity_fp32/" +cp /opt/tritonserver/qa/python_models/identity_fp32/model.py "${MODELDIR}/identity_fp32/1/" + mkdir -p "${MODELDIR}/identity_bytes/1" -cp ${MODELDIR}/identity_fp32/config.pbtxt "${MODELDIR}/identity_bytes/" -cp ${MODELDIR}/identity_fp32/1/model.py "${MODELDIR}/identity_bytes/1/" +cp /opt/tritonserver/qa/python_models/identity_fp32/config.pbtxt "${MODELDIR}/identity_bytes/" +cp /opt/tritonserver/qa/python_models/identity_fp32/model.py "${MODELDIR}/identity_bytes/1/" (cd "${MODELDIR}/identity_bytes" && \ sed -i 's/identity_fp32/identity_bytes/' config.pbtxt && \ sed -i 's/TYPE_FP32/TYPE_STRING/' config.pbtxt ) From 8744c177b2aaaf59e13d3acf6550856edf64d86a Mon Sep 17 00:00:00 2001 From: Sai Kiran Polisetty Date: Tue, 1 Jul 2025 10:03:26 +0530 Subject: [PATCH 10/10] Update --- qa/L0_parameters/test.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/qa/L0_parameters/test.sh b/qa/L0_parameters/test.sh index 3b7a6c8eba..63868237aa 100755 --- a/qa/L0_parameters/test.sh +++ b/qa/L0_parameters/test.sh @@ -99,18 +99,19 @@ done # Test Classification Extension +PYTHON_MODELS_DIR="${PYTHON_MODELS_DIR:-/opt/tritonserver/qa/python_models}" MODELDIR="models" TEST_RESULT_FILE="test_results.txt" TEST_SCRIPT_PY="./class_count_test.py" rm -rf $MODELDIR mkdir -p "${MODELDIR}/identity_fp32/1" -cp /opt/tritonserver/qa/python_models/identity_fp32/config.pbtxt "${MODELDIR}/identity_fp32/" -cp /opt/tritonserver/qa/python_models/identity_fp32/model.py "${MODELDIR}/identity_fp32/1/" +cp ${PYTHON_MODELS_DIR}/identity_fp32/config.pbtxt "${MODELDIR}/identity_fp32/" +cp ${PYTHON_MODELS_DIR}/identity_fp32/model.py "${MODELDIR}/identity_fp32/1/" mkdir -p "${MODELDIR}/identity_bytes/1" -cp /opt/tritonserver/qa/python_models/identity_fp32/config.pbtxt "${MODELDIR}/identity_bytes/" -cp /opt/tritonserver/qa/python_models/identity_fp32/model.py "${MODELDIR}/identity_bytes/1/" +cp ${PYTHON_MODELS_DIR}/identity_fp32/config.pbtxt "${MODELDIR}/identity_bytes/" +cp ${PYTHON_MODELS_DIR}/identity_fp32/model.py "${MODELDIR}/identity_bytes/1/" (cd "${MODELDIR}/identity_bytes" && \ sed -i 's/identity_fp32/identity_bytes/' config.pbtxt && \ sed -i 's/TYPE_FP32/TYPE_STRING/' config.pbtxt )