Skip to content

Commit

Permalink
Merge pull request #183 from adriangonz/update-mlserver
Browse files Browse the repository at this point in the history
Bump MLServer to 0.4.0
  • Loading branch information
ukclivecox authored Aug 5, 2021
2 parents 656a06d + 7fbc38f commit 7206a0c
Show file tree
Hide file tree
Showing 13 changed files with 18 additions and 16 deletions.
2 changes: 1 addition & 1 deletion conda/tempo-examples.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ dependencies:
- alibi==0.5.7
- alibi-detect==0.6.0
- dill
- mlserver==0.3.2
- mlserver==0.4.0
- xgboost
- ansible
- openshift
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/asyncio/artifacts/classifier/conda.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ dependencies:
- python=3.7.9
- pip:
- mlops-tempo
- mlserver==0.3.2
- mlserver==0.4.0
2 changes: 1 addition & 1 deletion docs/examples/custom-model/artifacts/conda.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ dependencies:
- python=3.7.9
- pip:
- mlops-tempo
- mlserver==0.3.2
- mlserver==0.4.0
- numpyro==0.6.0
2 changes: 1 addition & 1 deletion docs/examples/explainer/artifacts/explainer/conda.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ dependencies:
- alibi==0.5.8
- dill
- mlops-tempo
- mlserver==0.3.2
- mlserver==0.4.0
2 changes: 1 addition & 1 deletion docs/examples/kfserving/artifacts/classifier/conda.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ dependencies:
- python=3.7.9
- pip:
- mlops-tempo
- mlserver==0.3.2
- mlserver==0.4.0
2 changes: 1 addition & 1 deletion docs/examples/logging-insights/artifacts/conda.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ dependencies:
- python=3.7.9
- pip:
- mlops-tempo @ file:///home/clive/work/mlops/fork-tempo
- mlserver==0.3.2
- mlserver==0.4.0
2 changes: 1 addition & 1 deletion docs/examples/logging-insights/conda.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ dependencies:
- python=3.7.9
- pip:
- mlops-tempo @ file:///home/alejandro/Programming/kubernetes/seldon/tempo
- mlserver==0.3.1.dev7
- mlserver==0.4.0
2 changes: 1 addition & 1 deletion docs/examples/multi-model/artifacts/classifier/conda.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ dependencies:
- python=3.7.9
- pip:
- mlops-tempo
- mlserver==0.3.2
- mlserver==0.4.0
2 changes: 1 addition & 1 deletion docs/examples/outlier/artifacts/outlier/conda.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ dependencies:
- dill==0.3.2
- opencv-python-headless
- mlops-tempo
- mlserver==0.3.2
- mlserver==0.4.0
2 changes: 1 addition & 1 deletion docs/examples/outlier/artifacts/svc/conda.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ dependencies:
- python=3.7.9
- pip:
- mlops-tempo
- mlserver==0.3.2
- mlserver==0.4.0
2 changes: 1 addition & 1 deletion tempo/seldon/constants.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
MLSERVER_IMAGE = "seldonio/mlserver:0.3.2"
MLSERVER_IMAGE = "seldonio/mlserver:0.4.0"
TRITON_IMAGE = "nvcr.io/nvidia/tritonserver:20.08-py3"
2 changes: 1 addition & 1 deletion tempo/serve/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
DefaultRemoteFilename = "remote.pickle"
DefaultEnvFilename = "environment.tar.gz"

MLServerEnvDeps = ["mlserver==0.3.2"]
MLServerEnvDeps = ["mlserver==0.4.0"]
DefaultCondaFile = "conda.yaml"

ENV_K8S_SERVICE_HOST = "KUBERNETES_SERVICE_HOST"
Expand Down
10 changes: 6 additions & 4 deletions tests/test_mlserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
from inspect import iscoroutine

import pytest
from mlserver.codecs import NumpyCodec
from mlserver.settings import ModelSettings
from mlserver.types import InferenceRequest, RequestInput
from mlserver.utils import to_ndarray
from pytest_cases import fixture, parametrize_with_cases
from pytest_cases.common_pytest_lazy_values import is_lazy

Expand Down Expand Up @@ -48,7 +48,8 @@ async def test_predict(mlserver_runtime: InferenceRuntime, inference_request: In

assert len(res.outputs) == 1

pipeline_input = to_ndarray(inference_request.inputs[0])
codec = NumpyCodec()
pipeline_input = codec.decode(inference_request.inputs[0])
custom_model = copy.copy(mlserver_runtime._model)
# Ensure direct call to class does not try to do remote
custom_model.set_remote(False)
Expand All @@ -58,11 +59,12 @@ async def test_predict(mlserver_runtime: InferenceRuntime, inference_request: In

pipeline_output = res.outputs[0].data

assert expected_output.tolist() == pipeline_output
assert expected_output.tolist() == pipeline_output.__root__


async def test_load_wrapped_class(inference_pipeline_class, inference_request: InferenceRequest):
pipeline_input = to_ndarray(inference_request.inputs[0])
codec = NumpyCodec()
pipeline_input = codec.decode(inference_request.inputs[0])

inference_pipeline_class(pipeline_input)
assert inference_pipeline_class.counter == 1
Expand Down

0 comments on commit 7206a0c

Please sign in to comment.