You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/machine-learning/how-to-nlp-processing-batch.md
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -62,14 +62,14 @@ In this example, we are going to learn how to deploy a deep learning model based
62
62
63
63
Batch Endpoint can only deploy registered models. In this case, we need to publish the model we have just downloaded from HuggingFace. You can skip this step if the model you are trying to deploy is already registered.
64
64
65
-
# [Azure ML CLI](#tab/cli)
65
+
# [Azure CLI](#tab/cli)
66
66
67
-
```bash
67
+
```azurecli
68
68
MODEL_NAME='bart-text-summarization'
69
69
az ml model create --name $MODEL_NAME --type "custom_model" --path "bart-text-summarization/model"
70
70
```
71
71
72
-
# [Azure ML SDK for Python](#tab/sdk)
72
+
# [Python](#tab/sdk)
73
73
74
74
```python
75
75
model_name ='bart-text-summarization'
@@ -136,11 +136,11 @@ One the scoring script is created, it's time to create a batch deployment for it
136
136
137
137
1. We need to indicate over which environment we are going to run the deployment. In our case, our model runs on `TensorFlow`. Azure Machine Learning already has an environment with the required software installed, so we can reutilize this environment. We are just going to add a couple of dependencies in a `conda.yml` file including the libraries `transformers` and `datasets`.
138
138
139
-
# [Azure ML CLI](#tab/cli)
139
+
# [Azure CLI](#tab/cli)
140
140
141
141
No extra step is required for the Azure ML CLI. The environment definition will be included in the deployment file.
142
142
143
-
# [Azure ML SDK for Python](#tab/sdk)
143
+
# [Python](#tab/sdk)
144
144
145
145
Let's get a reference to the environment:
146
146
@@ -156,7 +156,7 @@ One the scoring script is created, it's time to create a batch deployment for it
156
156
> [!NOTE]
157
157
> This example assumes you have an endpoint created with the name `text-summarization-batch` and a compute cluster with name `cpu-cluster`. If you don't, please follow the steps in the doc [Use batch endpoints for batch scoring](how-to-use-batch-endpoint.md).
158
158
159
-
# [Azure ML CLI](#tab/cli)
159
+
# [Azure CLI](#tab/cli)
160
160
161
161
To create a new deployment under the created endpoint, create a `YAML` configuration like the following:
162
162
@@ -188,12 +188,12 @@ One the scoring script is created, it's time to create a batch deployment for it
188
188
189
189
Then, create the deployment with the following command:
190
190
191
-
```bash
191
+
```azurecli
192
192
DEPLOYMENT_NAME="text-summarization-hfbart"
193
193
az ml batch-deployment create -f endpoint.yml
194
194
```
195
195
196
-
# [Azure ML SDK for Python](#tab/sdk)
196
+
# [Python](#tab/sdk)
197
197
198
198
To create a new deployment with the indicated environment and scoring script use the following code:
199
199
@@ -231,13 +231,13 @@ One the scoring script is created, it's time to create a batch deployment for it
231
231
232
232
3. Although you can invoke a specific deployment inside of an endpoint, you will usually want to invoke the endpoint itself and let the endpoint decide which deployment to use. Such deployment is named the "default" deployment. This gives you the possibility of changing the default deployment and hence changing the model serving the deployment without changing the contract with the user invoking the endpoint. Use the following instruction to update the default deployment:
233
233
234
-
# [Azure ML CLI](#tab/cli)
234
+
# [Azure CLI](#tab/cli)
235
235
236
-
```bash
236
+
```azurecli
237
237
az ml batch-endpoint update --name $ENDPOINT_NAME --set defaults.deployment_name=$DEPLOYMENT_NAME
0 commit comments