Skip to content

Commit 3dcec44

Browse files
committed
Update code and text
1 parent c99eb24 commit 3dcec44

File tree

1 file changed

+57
-9
lines changed

1 file changed

+57
-9
lines changed

articles/machine-learning/how-to-deploy-mlflow-models-online-endpoints.md

Lines changed: 57 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -578,9 +578,9 @@ deployment_client.predict(endpoint=endpoint_name, df=samples)
578578

579579
MLflow models can use the __Test__ tab to create invocations to the created endpoints:
580580

581-
1. Go to the __Endpoints__ tab and select the endpoint you created.
581+
1. Select __Endpoints__, and then select the endpoint that you created.
582582
1. Go to the __Test__ tab.
583-
1. Paste the content of the file `sample-request-sklearn.json`.
583+
1. In the __Input__ box, paste the contents of the cli/endpoints/online/ncd/sample-request-sklearn.json file.
584584
1. Select __Test__.
585585
1. The box on the right displays the predictions.
586586

@@ -651,7 +651,7 @@ To deploy an MLflow model with a custom scoring script:
651651

652652
```pythonS
653653
environment = Environment(
654-
conda_file="sklearn-diabetes/environment/conda.yml",
654+
conda_file="sklearn-diabetes/environment/conda.yaml",
655655
image="mcr.microsoft.com/azureml/openmpi4.1.0-ubuntu22.04:latest",
656656
)
657657
```
@@ -715,6 +715,9 @@ To deploy an MLflow model with a custom scoring script:
715715
instance_type="Standard_F4s_v2",
716716
instance_count=1,
717717
)
718+
719+
ml_client.online_deployments.begin_create_or_update(blue_deployment)
720+
718721
```
719722

720723
# [Python (MLflow SDK)](#tab/mlflow)
@@ -745,8 +748,24 @@ To deploy an MLflow model with a custom scoring script:
745748

746749
1. When your deployment is complete, it's ready to serve requests. One way to test the deployment is to use the `invoke` method with a sample request file such as the following file, sample-request-sklearn.json:
747750

751+
# [Azure CLI](#tab/cli)
752+
753+
:::code language="json" source="~/azureml-examples-main/cli/endpoints/online/ncd/sample-request-sklearn.json":::
754+
755+
# [Python (Azure Machine Learning SDK)](#tab/sdk)
756+
757+
:::code language="json" source="~/azureml-examples-main/sdk/python/endpoints/online/mlflow/sample-request-sklearn.json":::
758+
759+
# [Python (MLflow SDK)](#tab/mlflow)
760+
761+
This operation isn't supported in the MLflow SDK.
762+
763+
# [Studio](#tab/studio)
764+
748765
:::code language="json" source="~/azureml-examples-main/cli/endpoints/online/ncd/sample-request-sklearn.json":::
749766

767+
---
768+
750769
Submit a request to the endpoint:
751770

752771
# [Azure CLI](#tab/cli)
@@ -756,7 +775,7 @@ To deploy an MLflow model with a custom scoring script:
756775
# [Python (Azure Machine Learning SDK)](#tab/sdk)
757776

758777
```python
759-
ml_client.online_endpoints.invoke(
778+
response = ml_client.online_endpoints.invoke(
760779
endpoint_name=endpoint_name,
761780
deployment_name=deployment.name,
762781
request_file="sample-request-sklearn.json",
@@ -769,25 +788,54 @@ To deploy an MLflow model with a custom scoring script:
769788

770789
# [Studio](#tab/studio)
771790

772-
1. Go to the __Endpoints__ tab and select the endpoint that you created.
791+
1. Select __Endpoints__, and then select the endpoint that you created.
773792
1. Go to the __Test__ tab.
774-
1. Paste the contents of the `sample-request-sklearn.json` file into the __Input data to test endpoint__ box.
793+
1. In the __Input__ box, paste the contents of the cli/endpoints/online/ncd/sample-request-sklearn.json file.
775794
1. Select __Test__.
776-
1. The predictions are displayed under "Test results" on the right side of the box.
795+
1. The box on the right displays the predictions.
777796

778797
---
779798

780799
The response should be similar to the following text:
781800

801+
# [Azure CLI](#tab/cli)
802+
803+
```json
804+
{
805+
"predictions": [
806+
1095.2797413413252,
807+
1134.585328803727
808+
]
809+
}
810+
```
811+
812+
# [Python (Azure Machine Learning SDK)](#tab/sdk)
813+
814+
```json
815+
{
816+
"predictions": [
817+
1095.2797413413252
818+
]
819+
}
820+
```
821+
822+
# [Python (MLflow SDK)](#tab/mlflow)
823+
824+
This operation isn't supported in the MLflow SDK.
825+
826+
# [Studio](#tab/studio)
827+
782828
```json
783829
{
784830
"predictions": [
785-
11633.100167144921,
786-
8522.117402884991
831+
1095.2797413413252,
832+
1134.585328803727
787833
]
788834
}
789835
```
790836

837+
---
838+
791839
> [!WARNING]
792840
> __MLflow 2.0 advisory__: In MLflow 1.X, the response doesn't contain the `predictions` key.
793841

0 commit comments

Comments
 (0)