From 77781b90ff81320aaf547596c9c567b3a19362f0 Mon Sep 17 00:00:00 2001 From: Valeriy Khakhutskyy <1292899+valeriy42@users.noreply.github.com> Date: Tue, 11 Jul 2023 10:55:11 +0200 Subject: [PATCH] [ML] Update trained model inference endpoint (#556) Infer trained model deployment API has been deprecated, so I changed the code to use the new one. --- README.md | 2 +- eland/ml/pytorch/_pytorch_model.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ca68121..2ed167d 100644 --- a/README.md +++ b/README.md @@ -245,7 +245,7 @@ The `--start` argument will deploy the model with one allocation and one thread per allocation, which will not offer good performance. When starting the model deployment using the ML UI in Kibana or the Elasticsearch [API](https://www.elastic.co/guide/en/elasticsearch/reference/current/start-trained-model-deployment.html) -you will be able to set the threading options to make best use of your +you will be able to set the threading options to make the best use of your hardware. ```python diff --git a/eland/ml/pytorch/_pytorch_model.py b/eland/ml/pytorch/_pytorch_model.py index e604880..de1b550 100644 --- a/eland/ml/pytorch/_pytorch_model.py +++ b/eland/ml/pytorch/_pytorch_model.py @@ -134,7 +134,7 @@ class PyTorchModel: __body: Dict[str, Any] = {} __body["docs"] = docs - __path = f"/_ml/trained_models/{_quote(self.model_id)}/deployment/_infer" + __path = f"/_ml/trained_models/{_quote(self.model_id)}/_infer" __query: Dict[str, Any] = {} __query["timeout"] = timeout __headers = {"accept": "application/json", "content-type": "application/json"}