Update 1/model.py
This commit is contained in:
parent
6099f94aa9
commit
e154ef8e19
19
1/model.py
19
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))
|
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 출력 텐서로 변환합니다.
|
||||||
# 출력 텐서 생성
|
output_tensor = pb_utils.Tensor("OUTPUT", np.array(output.encode('utf-8'), dtype=np.bytes_))
|
||||||
out_tensor = pb_utils.Tensor("OUTPUT", output_array)
|
|
||||||
|
# 응답 객체를 생성하고 출력 텐서를 추가합니다.
|
||||||
# 추론 응답 생성
|
responses.append(pb_utils.InferenceResponse(output_tensors=[output_tensor]))
|
||||||
inference_response = pb_utils.InferenceResponse(
|
|
||||||
output_tensors=[out_tensor])
|
|
||||||
responses.append(inference_response)
|
|
||||||
|
|
||||||
return responses
|
return responses
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user