fix: kservev2 batching issue and missing parameters #3341
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Fix KServeV2 picking up only the first item from the list. As a result it is able to dynamically batch the requests. Updated that if the model returns a dictionary it picks up the keys as the names of the outputs.
Update the envelope to handle request parameters and input parameters
Fixes #2158
Type of change
Please delete options that are not relevant.
Feature/Issue validation/testing
Please describe the Unit or Integration tests that you ran to verify your changes and relevant result summary. Provide instructions so it can be reproduced.
Please also list any relevant details for your test configuration.
torchserve_sanity.py
OK
test_mnist_kf.py
Run completed, parsing output ./ts/torch_handler/unit_tests/test_mnist_kf.py::test_handle Passed ./ts/torch_handler/unit_tests/test_mnist_kf.py::test_handle_kf Passed ./ts/torch_handler/unit_tests/test_mnist_kf.py::test_handle_kfv2 Passed Total number of tests expected to run: 3 Total number of tests run: 3 Total number of tests passed: 3 Total number of tests failed: 0 Total number of tests failed with errors: 0 Total number of tests skipped: 0 Total number of tests with no result data: 0 Finished running tests!
Checklist: