28 lines
893 B
Python
28 lines
893 B
Python
# model.py - 최소한의 구현
|
|
import triton_python_backend_utils as pb_utils
|
|
import numpy as np
|
|
|
|
class TritonPythonModel:
|
|
def initialize(self, args):
|
|
print("Model initialized")
|
|
|
|
def execute(self, requests):
|
|
print(f"Received {len(requests)} requests")
|
|
responses = []
|
|
|
|
for i, request in enumerate(requests):
|
|
print(f"Processing request {i}")
|
|
|
|
# 고정된 응답 생성
|
|
output_data = "Hello World"
|
|
output_tensor = pb_utils.Tensor("OUTPUT", np.array([output_data]))
|
|
|
|
response = pb_utils.InferenceResponse(output_tensors=[output_tensor])
|
|
responses.append(response)
|
|
print(f"Response {i} created")
|
|
|
|
print("All responses ready")
|
|
return responses
|
|
|
|
def finalize(self):
|
|
print("Model finalized") |