From e154ef8e195970d66cad791ce7ee380b5ba9a07f Mon Sep 17 00:00:00 2001 From: cheetahadmin Date: Wed, 17 Sep 2025 07:00:42 +0000 Subject: [PATCH] Update 1/model.py --- 1/model.py | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/1/model.py b/1/model.py index b1d317d..9135ee7 100644 --- a/1/model.py +++ b/1/model.py @@ -37,17 +37,14 @@ def initialize(self, args): # 무작위 문자열 생성 random_string = ''.join(random.choice(string.ascii_letters + string.digits) for _ in range(16)) - - # numpy 배열로 변환 - output_array = np.array([[random_string.encode('utf-8')]], dtype=self.output_dtype) - - # 출력 텐서 생성 - out_tensor = pb_utils.Tensor("OUTPUT", output_array) - - # 추론 응답 생성 - inference_response = pb_utils.InferenceResponse( - output_tensors=[out_tensor]) - responses.append(inference_response) + + output = random_string + + # 생성된 텍스트를 Triton 출력 텐서로 변환합니다. + output_tensor = pb_utils.Tensor("OUTPUT", np.array(output.encode('utf-8'), dtype=np.bytes_)) + + # 응답 객체를 생성하고 출력 텐서를 추가합니다. + responses.append(pb_utils.InferenceResponse(output_tensors=[output_tensor])) return responses