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))
|
||||
|
||||
# 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
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user