From 713a22b2553386689dd25eda2f84c117b67c14f8 Mon Sep 17 00:00:00 2001 From: manu-sj Date: Fri, 27 Jun 2025 18:10:06 +0200 Subject: [PATCH 1/2] adding docs for async predictor --- docs/user_guides/mlops/serving/predictor.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/docs/user_guides/mlops/serving/predictor.md b/docs/user_guides/mlops/serving/predictor.md index 79008919c..0d5d54362 100644 --- a/docs/user_guides/mlops/serving/predictor.md +++ b/docs/user_guides/mlops/serving/predictor.md @@ -171,6 +171,23 @@ Once you are done with the changes, click on `Create new deployment` at the bott # Use the model to make predictions # return self.model.predict(inputs) ``` +=== "Aysnc Predictor" + ``` python + class Predictor(): + + def __init__(self): + """ Initialization code goes here""" + # Model files can be found at os.environ["MODEL_FILES_PATH"] + # self.model = ... # load your model + + async def predict(self, inputs): + """ Asynchronously serve predictions using the trained model""" + # Preform async operations that required + # result = await some_async_preprocessing(inputs) + + # Use the model to make predictions + # return self.model.predict(result) + ``` === "Predictor (vLLM deployments only)" ``` python import os From 87506bbfadfebabc9a02d3724cc4bf60682fa616 Mon Sep 17 00:00:00 2001 From: manu-sj <152865565+manu-sj@users.noreply.github.com> Date: Mon, 30 Jun 2025 09:28:08 +0200 Subject: [PATCH 2/2] Update docs/user_guides/mlops/serving/predictor.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Javier de la Rúa Martínez --- docs/user_guides/mlops/serving/predictor.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user_guides/mlops/serving/predictor.md b/docs/user_guides/mlops/serving/predictor.md index 0d5d54362..1e5bd65b2 100644 --- a/docs/user_guides/mlops/serving/predictor.md +++ b/docs/user_guides/mlops/serving/predictor.md @@ -171,7 +171,7 @@ Once you are done with the changes, click on `Create new deployment` at the bott # Use the model to make predictions # return self.model.predict(inputs) ``` -=== "Aysnc Predictor" +=== "Async Predictor" ``` python class Predictor():