Update 1/model.py

This commit is contained in:
cheetahadmin 2025-09-17 07:00:42 +00:00
parent 6099f94aa9
commit e154ef8e19

@ -38,16 +38,13 @@ def initialize(self, args):
# 무작위 문자열 생성 # 무작위 문자열 생성
random_string = ''.join(random.choice(string.ascii_letters + string.digits) for _ in range(16)) random_string = ''.join(random.choice(string.ascii_letters + string.digits) for _ in range(16))
# numpy 배열로 변환 output = random_string
output_array = np.array([[random_string.encode('utf-8')]], dtype=self.output_dtype)
# 출력 텐서 생성 # 생성된 텍스트를 Triton 출력 텐서로 변환합니다.
out_tensor = pb_utils.Tensor("OUTPUT", output_array) output_tensor = pb_utils.Tensor("OUTPUT", np.array(output.encode('utf-8'), dtype=np.bytes_))
# 추론 응답 생성 # 응답 객체를 생성하고 출력 텐서를 추가합니다.
inference_response = pb_utils.InferenceResponse( responses.append(pb_utils.InferenceResponse(output_tensors=[output_tensor]))
output_tensors=[out_tensor])
responses.append(inference_response)
return responses return responses