Skip to content

Commit ba8f688

Browse files
committed
online
1 parent ea65b1d commit ba8f688

File tree

1 file changed

+20
-19
lines changed

1 file changed

+20
-19
lines changed

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

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -73,22 +73,22 @@ The workspace is the top-level resource for Azure Machine Learning, providing a
7373

7474
1. Import the required libraries:
7575

76-
```python
77-
from azure.ai.ml import MLClient, Input
78-
from azure.ai.ml.entities import ManagedOnlineEndpoint, ManagedOnlineDeployment, Model
79-
from azure.ai.ml.constants import AssetTypes
80-
from azure.identity import DefaultAzureCredential
81-
```
76+
```python
77+
from azure.ai.ml import MLClient, Input
78+
from azure.ai.ml.entities import ManagedOnlineEndpoint, ManagedOnlineDeployment, Model
79+
from azure.ai.ml.constants import AssetTypes
80+
from azure.identity import DefaultAzureCredential
81+
```
8282

8383
2. Configure workspace details and get a handle to the workspace:
8484

85-
```python
86-
subscription_id = "<subscription>"
87-
resource_group = "<resource-group>"
88-
workspace = "<workspace>"
89-
90-
ml_client = MLClient(DefaultAzureCredential(), subscription_id, resource_group, workspace)
91-
```
85+
```python
86+
subscription_id = "<subscription>"
87+
resource_group = "<resource-group>"
88+
workspace = "<workspace>"
89+
90+
ml_client = MLClient(DefaultAzureCredential(), subscription_id, resource_group, workspace)
91+
```
9292

9393
# [Studio](#tab/studio)
9494

@@ -144,11 +144,12 @@ az ml model create --name $MODEL_NAME --path azureml://jobs/$RUN_ID/outputs/arti
144144
# [Python](#tab/sdk)
145145

146146
```python
147+
model_name = 'sklearn-diabetes'
148+
147149
ml_client.models.create_or_update(
148150
Model(
149151
path=f"azureml://jobs/{RUN_ID}/outputs/artifacts/{MODEL_PATH}"
150-
name="run-model-example",
151-
description="Model created from run.",
152+
name=model_name,
152153
type=AssetTypes.MLFLOW_MODEL
153154
)
154155
)
@@ -233,7 +234,7 @@ ml_client.models.create_or_update(
233234
---
234235

235236
> [!NOTE]
236-
> `scoring_script` and `environment` auto generation are only supported for `pyfunc` model's flavor. To use a different flavor, see [Customizing MLflow model deployments](#customizing-mlflow-model-deploymentst).
237+
> `scoring_script` and `environment` auto generation are only supported for `pyfunc` model's flavor. To use a different flavor, see [Customizing MLflow model deployments](#customizing-mlflow-model-deployments).
237238

238239
1. Let's create the deployment:
239240

@@ -412,7 +413,7 @@ Use the following steps to deploy an MLflow model with a custom scoring script.
412413
image="mcr.microsoft.com/azureml/openmpi3.1.2-ubuntu18.04:latest",
413414
)
414415
```
415-
416+
416417
# [Studio](#tab/studio)
417418

418419
On [Azure ML studio portal](https://ml.azure.com), follow these steps:
@@ -471,7 +472,7 @@ Use the following steps to deploy an MLflow model with a custom scoring script.
471472
instance_count=1,
472473
)
473474
```
474-
475+
475476
# [Studio](#tab/studio)
476477

477478
> [!IMPORTANT]
@@ -524,7 +525,7 @@ Use the following steps to deploy an MLflow model with a custom scoring script.
524525
request_file="sample-request-sklearn-custom.json",
525526
)
526527
```
527-
528+
528529
# [Studio](#tab/studio)
529530

530531
MLflow models can use the __Test__ tab to create invocations to the created endpoints. To do that:

0 commit comments

Comments
 (0)