-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[python] validate each request in the batch #1008
Conversation
if self.rolling_batch_type: | ||
if inputs.get_property("reset_rollingbatch"): | ||
self.rolling_batch.reset() | ||
result = self.rolling_batch.inference(input_data, parameters) | ||
for i in range(inputs.get_batch_size()): | ||
outputs.add(result[i], key="data", batch_index=i) | ||
for i in range(len(input_data)): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use input size
if err: | ||
outputs.add(err, key="data", batch_index=i) | ||
else: | ||
outputs.add(result[i], key="data", batch_index=i) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i is not the right index, probably we need to +1 everytime we insert a new value. Or use iterator to iter a value.
|
||
prediction = self.hf_pipeline(input_data, **parameters[0]) | ||
else: | ||
prediction = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to check rolling batch here. If rolling batch, need to return all errors
bf92704
to
252b199
Compare
inputs) | ||
if len(input_data) == 0: | ||
for i in range(len(batch)): | ||
outputs.add(errors.get(i), key="data", batch_index=i) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this work for dynamic batch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this place may also need the json double dumps
9aa4816
to
741beb8
Compare
Description
Brief description of what this PR is about