Skip to content

Commit

Permalink
fix(executer): Forward parameters while chaining models via kfserve g…
Browse files Browse the repository at this point in the history
…rpc (#4054)

* Minor formatting

Co-authored-by: Roman Seyffarth <roman.seyffarth@codecentric.de>

Co-authored-by: Roman Seyffarth <roman.seyffarth@codecentric.de>
  • Loading branch information
sebastianmarkow and romansey authored Apr 21, 2022
1 parent c4c915c commit e48acc9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
10 changes: 6 additions & 4 deletions executor/api/grpc/kfserving/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ package kfserving
import (
"context"
"fmt"
"io"
"math"

"github.com/go-logr/logr"
"github.com/pkg/errors"
"github.com/seldonio/seldon-core/executor/api/client"
Expand All @@ -11,8 +14,6 @@ import (
"github.com/seldonio/seldon-core/executor/api/payload"
v1 "github.com/seldonio/seldon-core/operator/apis/machinelearning.seldon.io/v1"
"google.golang.org/grpc"
"io"
"math"
logf "sigs.k8s.io/controller-runtime/pkg/log"
)

Expand Down Expand Up @@ -133,8 +134,9 @@ func (s *KFServingGrpcClient) Chain(ctx context.Context, modelName string, msg p
}

pr := inference.ModelInferRequest{
ModelName: modelName,
Inputs: inputTensors,
ModelName: modelName,
Inputs: inputTensors,
Parameters: v.Parameters,
}
msg2 := payload.ProtoPayload{Msg: &pr}
return &msg2, nil
Expand Down
10 changes: 10 additions & 0 deletions executor/api/grpc/kfserving/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ func TestChain(t *testing.T) {
Contents: &inference.InferTensorContents{IntContents: []int32{1}},
},
},
Parameters: map[string]*inference.InferParameter{
"param-1-bool": {ParameterChoice: &inference.InferParameter_BoolParam{BoolParam: true}},
"param-1-int64": {ParameterChoice: &inference.InferParameter_Int64Param{Int64Param: 42}},
"param-1-string": {ParameterChoice: &inference.InferParameter_StringParam{StringParam: "param"}},
},
},
},
expected: &payload.ProtoPayload{
Expand All @@ -105,6 +110,11 @@ func TestChain(t *testing.T) {
Contents: &inference.InferTensorContents{IntContents: []int32{1}},
},
},
Parameters: map[string]*inference.InferParameter{
"param-1-bool": {ParameterChoice: &inference.InferParameter_BoolParam{BoolParam: true}},
"param-1-int64": {ParameterChoice: &inference.InferParameter_Int64Param{Int64Param: 42}},
"param-1-string": {ParameterChoice: &inference.InferParameter_StringParam{StringParam: "param"}},
},
},
},
},
Expand Down

0 comments on commit e48acc9

Please sign in to comment.