Skip to content

Commit

Permalink
pass parameter in rest v2 infer (kserve#2797)
Browse files Browse the repository at this point in the history
* pass parameter  in rest v2 infer

Signed-off-by: Naegionn <41356653+Naegionn@users.noreply.github.com>

* Set parameter to empty dict if it is none

Signed-off-by: Lukas <41356653+Naegionn@users.noreply.github.com>

---------

Signed-off-by: Naegionn <41356653+Naegionn@users.noreply.github.com>
Signed-off-by: Lukas <41356653+Naegionn@users.noreply.github.com>
  • Loading branch information
Naegionn authored Apr 8, 2023
1 parent 5980cf6 commit 94052fd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion python/kserve/kserve/protocol/rest/v2_endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ async def infer(

request_headers = dict(raw_request.headers)
infer_inputs = [InferInput(name=input.name, shape=input.shape, datatype=input.datatype,
data=input.data) for input in request_body.inputs]
data=input.data,
parameters={} if input.parameters is None else input.parameters
) for input in request_body.inputs]
infer_request = InferRequest(model_name=model_name, infer_inputs=infer_inputs)
response, response_headers = await self.dataplane.infer(
model_name=model_name, body=infer_request, headers=request_headers)
Expand Down

0 comments on commit 94052fd

Please sign in to comment.