Skip to content

Commit 8dd9299

Browse files
authored
Parameterize model name and version and change archive to delete
1 parent db172c6 commit 8dd9299

File tree

1 file changed

+13
-15
lines changed

1 file changed

+13
-15
lines changed

articles/machine-learning/how-to-deploy-with-triton.md

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -197,11 +197,19 @@ This section shows how you can define a Triton deployment to deploy to a managed
197197
198198
```python
199199
from azure.ai.ml.entities import ManagedOnlineDeployment, Model
200-
200+
201+
model_name = "densenet-onnx-model"
202+
model_version = 1
203+
201204
deployment = ManagedOnlineDeployment(
202205
name="blue",
203206
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+
),
205213
instance_type="Standard_NC6s_v3",
206214
instance_count=1,
207215
)
@@ -435,33 +443,23 @@ To test an endpoint using Azure Machine Learning Studio, click `Test` from the E
435443
436444
:::code language="azurecli" source="~/azureml-examples-main/cli/deploy-triton-managed-online-endpoint.sh" ID="delete_endpoint":::
437445
438-
1. Use the following command to delete your model:
446+
1. Use the following command to archive your model:
439447
440448
```azurecli
441-
az ml model delete --name $MODEL_NAME --version $MODEL_VERSION
449+
az ml model archive --name $MODEL_NAME --version $MODEL_VERSION
442450
```
443451
444452
# [Python](#tab/python)
445453
446454
[!INCLUDE [sdk v2](../../includes/machine-learning-sdk-v2.md)]
447455
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-
458456
1. Delete the endpoint. Deleting the endpoint also deletes any child deployments, however it will not archive associated Environments or Models.
459457
460458
```python
461459
ml_client.online_endpoints.begin_delete(name=endpoint_name)
462460
```
463461
464-
1. Delete the model with the following code.
462+
1. Archive the model with the following code.
465463
466464
```python
467465
ml_client.models.archive(name=model_name, version=model_version)

0 commit comments

Comments
 (0)