From 613e31c2c3072922e1bb728d17f9b31a6bf3bf65 Mon Sep 17 00:00:00 2001 From: zhlsunshine Date: Tue, 19 Mar 2024 17:43:45 +0800 Subject: [PATCH] fix some typos Signed-off-by: zhlsunshine --- ...ased-Custom-Runtime-with-Model-Stored-on-PVC.md | 14 +++++--------- .../custom-model/custom_model.py | 4 ++-- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/docs/runtimes/python-based-custom-runtime-example/Python-Based-Custom-Runtime-with-Model-Stored-on-PVC.md b/docs/runtimes/python-based-custom-runtime-example/Python-Based-Custom-Runtime-with-Model-Stored-on-PVC.md index 7ce59f69b..1da9214ed 100644 --- a/docs/runtimes/python-based-custom-runtime-example/Python-Based-Custom-Runtime-with-Model-Stored-on-PVC.md +++ b/docs/runtimes/python-based-custom-runtime-example/Python-Based-Custom-Runtime-with-Model-Stored-on-PVC.md @@ -155,7 +155,7 @@ from mlserver import MLModel from mlserver.utils import get_model_uri from mlserver.types import InferenceRequest, InferenceResponse, ResponseOutput, Parameters from mlserver.codecs import DecodedParameterName -from joblib import load # Add this line for importing joblib module +from joblib import load import logging import numpy as np @@ -177,7 +177,7 @@ class CustomMLModel(MLModel): # pylint:disable=c-extension-no-member logger.info("Model load URI: {model_uri}") if exists(model_uri): logger.info(f"Loading MNIST model from {model_uri}") - self._model = load(model_uri) # Changed 'joblib.load' to 'load' + self._model = load(model_uri) logger.info("Model loaded successfully") else: logger.info(f"Model not exist in {model_uri}") @@ -260,7 +260,7 @@ docker build -t /custom-model-server:0.1 . ``` -> **Note**: Please use the `--build-arg` to add the HTTP_PROXY if necessary, such as: +> **Note**: Please use the `--build-arg` to add the http proxy if there is proxy in user's environment, such as: ```shell docker build --build-arg HTTP_PROXY=http://:PORT --build-arg HTTPS_PROXY=http://:PORT -t /custom-model-server:0.1 . ``` @@ -385,12 +385,8 @@ curl -s -X POST -k "http://localhost:8008/v2/models/${MODEL_NAME}/infer" -d '{"i { "name": "predict", "datatype": "INT64", - "shape": [ - 1 - ], - "data": [ - 8 - ] + "shape": [1], + "data": [8] } ] } diff --git a/docs/runtimes/python-based-custom-runtime-example/custom-model/custom_model.py b/docs/runtimes/python-based-custom-runtime-example/custom-model/custom_model.py index 031dbc22c..40dd1e5f9 100644 --- a/docs/runtimes/python-based-custom-runtime-example/custom-model/custom_model.py +++ b/docs/runtimes/python-based-custom-runtime-example/custom-model/custom_model.py @@ -5,7 +5,7 @@ from mlserver.utils import get_model_uri from mlserver.types import InferenceRequest, InferenceResponse, ResponseOutput, Parameters from mlserver.codecs import DecodedParameterName -from joblib import load # Add this line for importing joblib module +from joblib import load import logging import numpy as np @@ -27,7 +27,7 @@ async def load(self) -> bool: logger.info("Model load URI: {model_uri}") if exists(model_uri): logger.info(f"Loading MNIST model from {model_uri}") - self._model = load(model_uri) # Changed 'joblib.load' to 'load' + self._model = load(model_uri) logger.info("Model loaded successfully") else: logger.info(f"Model not exist in {model_uri}")