Skip to content

Commit

Permalink
fix: readme docs
Browse files Browse the repository at this point in the history
 - add example handler
 - add example yamls
  • Loading branch information
jagadeesh committed Nov 9, 2021
1 parent bdb3e26 commit 571bee4
Show file tree
Hide file tree
Showing 12 changed files with 36 additions and 1 deletion.
File renamed without changes.
5 changes: 5 additions & 0 deletions kubernetes/kfserving/handler/v2/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Handler for KFServing v2 protocol

## For KFServing v2 protocol the tensor output should be converted to list of list with `[output.flatten().tolist()]` from the postprocess method in the handler.

### Refer: [mnist handler](./mnist_handler.py) and [bert_handler](./bert_handler.py)
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,3 @@ def postprocess(self, data):
list : A list of dictionary with predictons and explanations are returned.
"""
return [data.argmax(1).flatten().tolist()]

File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: "serving.kubeflow.org/v1beta1"
kind: "InferenceService"
metadata:
name: "torch-pred-gpu"
spec:
predictor:
pytorch:
protocolVersion: v1
storageUri: "pvc://model-store-claim"
resources:
limits:
memory: 4Gi
nvidia.com/gpu: 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: "serving.kubeflow.org/v1beta1"
kind: "InferenceService"
metadata:
name: "torch-pred-gs"
spec:
predictor:
pytorch:
protocolVersion: v1
storageUri: "gs://kfserving-examples/models/torchserve/image_classifier"
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: "serving.kubeflow.org/v1beta1"
kind: "InferenceService"
metadata:
name: "torch-pred"
spec:
predictor:
pytorch:
protocolVersion: v1
storageUri: "pvc://model-store-claim"

0 comments on commit 571bee4

Please sign in to comment.