Skip to content

Commit c99fbe0

Browse files
authored
Update how-to-mlflow-batch.md
1 parent 8587db4 commit c99fbe0

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

articles/machine-learning/batch-inference/how-to-mlflow-batch.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ Follow these steps to deploy an MLflow model to a batch endpoint for running bat
158158
159159
```azurecli
160160
ENDPOINT_NAME='heart-classifier-batch'
161-
az ml batch-endpoint create -f endpoint.yml
161+
az ml batch-endpoint create -n $ENDPOINT_NAME -f endpoint.yml
162162
```
163163

164164
# [Python](#tab/sdk)
@@ -170,6 +170,11 @@ Follow these steps to deploy an MLflow model to a batch endpoint for running bat
170170
name="heart-classifier-batch",
171171
description="A heart condition classifier for batch inference",
172172
)
173+
```
174+
175+
Then, create the endpoint with the following command:
176+
177+
```python
173178
ml_client.batch_endpoints.begin_create_or_update(endpoint)
174179
```
175180

@@ -203,12 +208,12 @@ Follow these steps to deploy an MLflow model to a batch endpoint for running bat
203208
204209
```azurecli
205210
DEPLOYMENT_NAME="classifier-xgboost-mlflow"
206-
az ml batch-deployment create -f endpoint.yml --set-default
211+
az ml batch-deployment create -n $DEPLOYMENT_NAME -f endpoint.yml
207212
```
208213

209214
# [Python](#tab/sdk)
210215

211-
To create a new deployment under the created endpoint, use the following script:
216+
To create a new deployment under the created endpoint, first define the deployment:
212217

213218
```python
214219
deployment = BatchDeployment(
@@ -225,15 +230,12 @@ Follow these steps to deploy an MLflow model to a batch endpoint for running bat
225230
retry_settings=BatchRetrySettings(max_retries=3, timeout=300),
226231
logging_level="info",
227232
)
228-
ml_client.batch_deployments.begin_create_or_update(deployment)
229233
```
230234

231-
Once created, you will need to set this deployment as the default one:
235+
Then, create the deployment with the following command:
232236

233237
```python
234-
endpoint = ml_client.batch_endpoints.get(endpoint.name)
235-
endpoint.defaults.deployment_name = deployment.name
236-
ml_client.batch_endpoints.begin_create_or_update(endpoint)
238+
ml_client.batch_deployments.begin_create_or_update(deployment)
237239
```
238240
---
239241

@@ -251,6 +253,7 @@ Follow these steps to deploy an MLflow model to a batch endpoint for running bat
251253
# [Python](#tab/sdk)
252254

253255
```python
256+
endpoint = ml_client.batch_endpoints.get(endpoint.name)
254257
endpoint.defaults.deployment_name = deployment.name
255258
ml_client.batch_endpoints.begin_create_or_update(endpoint)
256259
```

0 commit comments

Comments
 (0)