Skip to content

Commit

Permalink
undo output_batch_dim can be tuple
Browse files Browse the repository at this point in the history
  • Loading branch information
larme committed Sep 7, 2022
1 parent 1034237 commit 73886e7
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions bentoml/_internal/server/runner_app.py
Expand Up @@ -186,16 +186,9 @@ async def _run(requests: t.Iterable[Request]) -> list[Response]:
# multiple output branch
if isinstance(batch_ret, tuple):
output_num = len(batch_ret)
if isinstance(output_batch_dim, int):
output_batch_dim = (output_batch_dim,) * output_num
else:
assert (
len(output_batch_dim) == output_num
), "output_batch_dim length should be equal to the number of outputs"

payloadss = [
AutoContainer.batch_to_payloads(
batch_ret[idx], indices, batch_dim=output_batch_dim[idx]
batch_ret[idx], indices, batch_dim=output_batch_dim
)
for idx in range(output_num)
]
Expand All @@ -213,9 +206,6 @@ async def _run(requests: t.Iterable[Request]) -> list[Response]:
]

# single output branch
assert isinstance(
output_batch_dim, int
), "output_batch_dim's should be int for single output"
payloads = AutoContainer.batch_to_payloads(
batch_ret,
indices,
Expand Down

0 comments on commit 73886e7

Please sign in to comment.