@@ -197,11 +197,19 @@ This section shows how you can define a Triton deployment to deploy to a managed
197
197
198
198
```python
199
199
from azure.ai.ml.entities import ManagedOnlineDeployment, Model
200
-
200
+
201
+ model_name = "densenet-onnx-model"
202
+ model_version = 1
203
+
201
204
deployment = ManagedOnlineDeployment(
202
205
name="blue",
203
206
endpoint_name=endpoint_name,
204
- model=Model(path="./models", type="triton_model"),
207
+ model=Model(
208
+ name=model_name,
209
+ version=model_version,
210
+ path="./models",
211
+ type="triton_model"
212
+ ),
205
213
instance_type="Standard_NC6s_v3",
206
214
instance_count=1,
207
215
)
@@ -435,33 +443,23 @@ To test an endpoint using Azure Machine Learning Studio, click `Test` from the E
435
443
436
444
:::code language="azurecli" source="~/azureml-examples-main/cli/deploy-triton-managed-online-endpoint.sh" ID="delete_endpoint":::
437
445
438
- 1. Use the following command to delete your model:
446
+ 1. Use the following command to archive your model:
439
447
440
448
```azurecli
441
- az ml model delete --name $MODEL_NAME --version $MODEL_VERSION
449
+ az ml model archive --name $MODEL_NAME --version $MODEL_VERSION
442
450
```
443
451
444
452
# [Python](#tab/python)
445
453
446
454
[!INCLUDE [sdk v2](../../includes/machine-learning-sdk-v2.md)]
447
455
448
- 1. Get the name and version of the anonymous model in order to archive it.
449
-
450
- ```python
451
- deployment = ml_client.online_deployments.get(name="blue", endpoint_name=endpoint_name)
452
-
453
- model_uri = deployment.model.split("/")
454
- model_name = model_uri[-3]
455
- model_version = model_uri[-1]
456
- ```
457
-
458
456
1. Delete the endpoint. Deleting the endpoint also deletes any child deployments, however it will not archive associated Environments or Models.
459
457
460
458
```python
461
459
ml_client.online_endpoints.begin_delete(name=endpoint_name)
462
460
```
463
461
464
- 1. Delete the model with the following code.
462
+ 1. Archive the model with the following code.
465
463
466
464
```python
467
465
ml_client.models.archive(name=model_name, version=model_version)
0 commit comments