Skip to content

Commit

Permalink
apply black lint
Browse files Browse the repository at this point in the history
  • Loading branch information
ancom21c committed May 23, 2024
1 parent 331d146 commit d255b64
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 16 deletions.
17 changes: 4 additions & 13 deletions model_repository/sample_multiple_hybrid_dims/1/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,20 @@ def initialize(self, args):
self.model_config = model_config = json.loads(args["model_config"])
output_configs = model_config["output"]

self.output_name_list = [
output_config["name"] for output_config in output_configs
]
self.output_name_list = [output_config["name"] for output_config in output_configs]
self.output_dtype_list = [
pb_utils.triton_string_to_numpy(output_config["data_type"])
for output_config in output_configs
pb_utils.triton_string_to_numpy(output_config["data_type"]) for output_config in output_configs
]

def execute(self, requests):
responses = [None for _ in requests]
for idx, request in enumerate(requests):
current_add_value = int(json.loads(request.parameters()).get("add", 0))
in_tensor = [
item.as_numpy() + current_add_value
for item in request.inputs()
if "model_in" in item.name()
]
in_tensor = [item.as_numpy() + current_add_value for item in request.inputs() if "model_in" in item.name()]

out_tensor = [
pb_utils.Tensor(output_name, x.astype(output_dtype))
for x, output_name, output_dtype in zip(
in_tensor, self.output_name_list, self.output_dtype_list
)
for x, output_name, output_dtype in zip(in_tensor, self.output_name_list, self.output_dtype_list)
]
inference_response = pb_utils.InferenceResponse(output_tensors=out_tensor)
out_tensor.append(
Expand Down
4 changes: 1 addition & 3 deletions tritony/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,9 +493,7 @@ def _call_request(
if model_spec.max_batch_size == 0:
result_by_output_name = zipped_result
else:
result_by_output_name = list(
map(lambda ll: safe_concatenate(ll, axis=0), zipped_result)
)
result_by_output_name = list(map(lambda ll: safe_concatenate(ll, axis=0), zipped_result))

if len(result_by_output_name) == 1:
result_by_output_name = result_by_output_name[0]
Expand Down

0 comments on commit d255b64

Please sign in to comment.