Skip to content

Commit

Permalink
add testing instructions for sklearn server
Browse files Browse the repository at this point in the history
  • Loading branch information
ca-scribner committed Feb 29, 2024
1 parent d4fc033 commit 99b92c8
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions sklearnserver/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
## Testing instructions

From the [upstream usage example](https://kserve.github.io/website/master/modelserving/v1beta1/sklearn/v2/#deploy-the-model-with-rest-endpoint-through-inferenceservice/), this rock can be tested locally using:

Launch the server with:
```
# download the model locally
gsutil cp -r gs://kfserving-examples/models/sklearn/1.0/model ./sample_model/
# mount the model into the container at runtime
docker run -p 8080:8080 -v $(pwd)/sample_model:/mnt/models sklearnserver:0.11.2 --model_name test_model --model_dir=/mnt/models --http_port=8080
```

Test the server with:
```
cat <<EOF >> iris-input-v2.json
{
"inputs": [
{
"name": "input-0",
"shape": [2, 4],
"datatype": "FP32",
"data": [
[6.8, 2.8, 4.8, 1.4],
[6.0, 3.4, 4.5, 1.6]
]
}
]
}
EOF
curl -v \
-H "Content-Type: application/json" \
-d @./iris-input-v2.json \
localhost:8080/v2/models/test_model/infer
```

which should return the expected output described in the docs.

0 comments on commit 99b92c8

Please sign in to comment.