Skip to content

What is the correct way of using batches? Help me understand how BentoML create batches #1255

Answered by yubozhao
maikelroennau asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @maikelronnau, Good question.

When you have batch mode on, BentoML will attempt to group the incoming requests together in a small batch.

For your case, if you are sending each item separately, BentoML will combine those requests together in a list.

# request 1:
{ "client_id": "AAABBB", "image": "aaaAAA"}
# request 2:
{ "client_id": "CCCDDD", "image": "bbbBBB"}

#BentoML will pass the requests data in form of a list to the function:
[
      { "client_id": "AAABBB", "image": "aaaAAA"},
      { "client_id": "CCCDDD", "image": "bbbBBB"}
]

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@maikelroennau
Comment options

Answer selected by maikelroennau
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants