Skip to content

Commit 50eee83

Browse files
Fix batch SDK sample script errors (Azure#1910)
1 parent ae20016 commit 50eee83

7 files changed

+76
-507
lines changed

sdk/python/dev-requirements.txt

+3
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,6 @@ ipykernel==5.5.5
55
papermill==2.3.3
66
pandas
77
matplotlib
8+
tensorflow
9+
tensorflow-hub
10+
transformers

sdk/python/endpoints/batch/custom-output-batch.ipynb

+16-9
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@
7272
},
7373
"outputs": [],
7474
"source": [
75-
"subscription_id = \"<subscription>\"\n",
76-
"resource_group = \"<resource-group>\"\n",
77-
"workspace = \"<workspace>\""
75+
"subscription_id = \"<SUBSCRIPTION_ID>\"\n",
76+
"resource_group = \"<RESOURCE_GROUP>\"\n",
77+
"workspace = \"<AML_WORKSPACE_NAME>\""
7878
]
7979
},
8080
{
@@ -228,8 +228,15 @@
228228
},
229229
"outputs": [],
230230
"source": [
231+
"import random\n",
232+
"import string\n",
233+
"\n",
234+
"# Creating a unique endpoint name by including a random suffix\n",
235+
"allowed_chars = string.ascii_lowercase + string.digits\n",
236+
"endpoint_suffix = ''.join(random.choice(allowed_chars) for x in range(5))\n",
237+
"\n",
231238
"endpoint = BatchEndpoint(\n",
232-
" name=\"heart-classifier-batch\",\n",
239+
" name=\"heart-classifier-\" + endpoint_suffix,\n",
233240
" description=\"A heart condition classifier for batch inference\",\n",
234241
")"
235242
]
@@ -587,7 +594,7 @@
587594
"outputs": [],
588595
"source": [
589596
"heart_dataset_unlabeled = ml_client.data.get(\n",
590-
" name=\"heart-dataset-unlabeled\", label=\"latest\"\n",
597+
" name=dataset_name, label=\"latest\"\n",
591598
")"
592599
]
593600
},
@@ -763,9 +770,9 @@
763770
"name": "amlv2"
764771
},
765772
"kernelspec": {
766-
"display_name": "Python 3.10 - SDK V2",
773+
"display_name": "Python 3.11.0 64-bit",
767774
"language": "python",
768-
"name": "python310-sdkv2"
775+
"name": "python3"
769776
},
770777
"language_info": {
771778
"codemirror_mode": {
@@ -777,14 +784,14 @@
777784
"name": "python",
778785
"nbconvert_exporter": "python",
779786
"pygments_lexer": "ipython3",
780-
"version": "3.8.10"
787+
"version": "3.11.0"
781788
},
782789
"nteract": {
783790
"version": "[email protected]"
784791
},
785792
"vscode": {
786793
"interpreter": {
787-
"hash": "31f2aee4e71d21fbe5cf8b01ff0e069b9275f58929596ceb00d14d90e3e16cd6"
794+
"hash": "97244a77a34cba5e2b1e39283dc2fb6fff847d184db3eb48522848cc6c29e077"
788795
}
789796
}
790797
},

sdk/python/endpoints/batch/imagenet-classifier-batch.ipynb

+13-10
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,7 @@
7676
"# enter details of your AML workspace\n",
7777
"subscription_id = \"<SUBSCRIPTION_ID>\"\n",
7878
"resource_group = \"<RESOURCE_GROUP>\"\n",
79-
"workspace = \"<AML_WORKSPACE_NAME>\"\n",
80-
"\n",
81-
"subscription_id = \"18522758-626e-4d88-92ac-dc9c7a5c26d4\"\n",
82-
"resource_group = \"Analytics.Aml.Experiments.Workspaces\"\n",
83-
"workspace = \"aa-ml-aml-workspace\""
79+
"workspace = \"<AML_WORKSPACE_NAME>\""
8480
]
8581
},
8682
{
@@ -449,7 +445,14 @@
449445
},
450446
"outputs": [],
451447
"source": [
452-
"endpoint_name = \"imagenet-classifier-batch\"\n",
448+
"import random\n",
449+
"import string\n",
450+
"\n",
451+
"# Creating a unique endpoint name by including a random suffix\n",
452+
"allowed_chars = string.ascii_lowercase + string.digits\n",
453+
"endpoint_suffix = ''.join(random.choice(allowed_chars) for x in range(5))\n",
454+
"endpoint_name = \"imagenet-classifier-\" + endpoint_suffix\n",
455+
"\n",
453456
"endpoint = BatchEndpoint(\n",
454457
" name=endpoint_name,\n",
455458
" description=\"An batch service to perform imagenet image classification\",\n",
@@ -1624,9 +1627,9 @@
16241627
"name": "amlv2"
16251628
},
16261629
"kernelspec": {
1627-
"display_name": "Python 3.10 - SDK V2",
1630+
"display_name": "Python 3.11.0 64-bit",
16281631
"language": "python",
1629-
"name": "python310-sdkv2"
1632+
"name": "python3"
16301633
},
16311634
"language_info": {
16321635
"codemirror_mode": {
@@ -1638,14 +1641,14 @@
16381641
"name": "python",
16391642
"nbconvert_exporter": "python",
16401643
"pygments_lexer": "ipython3",
1641-
"version": "3.6.9"
1644+
"version": "3.11.0"
16421645
},
16431646
"nteract": {
16441647
"version": "[email protected]"
16451648
},
16461649
"vscode": {
16471650
"interpreter": {
1648-
"hash": "31f2aee4e71d21fbe5cf8b01ff0e069b9275f58929596ceb00d14d90e3e16cd6"
1651+
"hash": "97244a77a34cba5e2b1e39283dc2fb6fff847d184db3eb48522848cc6c29e077"
16491652
}
16501653
}
16511654
},

sdk/python/endpoints/batch/mlflow-for-batch-tabular.ipynb

+15-8
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@
6868
},
6969
"outputs": [],
7070
"source": [
71-
"subscription_id = \"<subscription>\"\n",
72-
"resource_group = \"<resource-group>\"\n",
73-
"workspace = \"<workspace>\""
71+
"subscription_id = \"<SUBSCRIPTION_ID>\"\n",
72+
"resource_group = \"<RESOURCE_GROUP>\"\n",
73+
"workspace = \"<AML_WORKSPACE_NAME>\""
7474
]
7575
},
7676
{
@@ -224,8 +224,15 @@
224224
},
225225
"outputs": [],
226226
"source": [
227+
"import random\n",
228+
"import string\n",
229+
"\n",
230+
"# Creating a unique endpoint name by including a random suffix\n",
231+
"allowed_chars = string.ascii_lowercase + string.digits\n",
232+
"endpoint_suffix = ''.join(random.choice(allowed_chars) for x in range(5))\n",
233+
"\n",
227234
"endpoint = BatchEndpoint(\n",
228-
" name=\"heart-classifier-batch\",\n",
235+
" name=\"heart-classifier-\" + endpoint_suffix,\n",
229236
" description=\"A heart condition classifier for batch inference\",\n",
230237
")"
231238
]
@@ -842,9 +849,9 @@
842849
"name": "amlv2"
843850
},
844851
"kernelspec": {
845-
"display_name": "Python 3.10 - SDK V2",
852+
"display_name": "Python 3.11.0 64-bit",
846853
"language": "python",
847-
"name": "python310-sdkv2"
854+
"name": "python3"
848855
},
849856
"language_info": {
850857
"codemirror_mode": {
@@ -856,14 +863,14 @@
856863
"name": "python",
857864
"nbconvert_exporter": "python",
858865
"pygments_lexer": "ipython3",
859-
"version": "3.6.9"
866+
"version": "3.11.0"
860867
},
861868
"nteract": {
862869
"version": "[email protected]"
863870
},
864871
"vscode": {
865872
"interpreter": {
866-
"hash": "31f2aee4e71d21fbe5cf8b01ff0e069b9275f58929596ceb00d14d90e3e16cd6"
873+
"hash": "97244a77a34cba5e2b1e39283dc2fb6fff847d184db3eb48522848cc6c29e077"
867874
}
868875
}
869876
},

sdk/python/endpoints/batch/mnist-batch.ipynb

+14-9
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,13 @@
126126
},
127127
"outputs": [],
128128
"source": [
129-
"# Creating a unique endpoint name with current datetime to avoid conflicts\n",
130-
"import datetime\n",
129+
"import random\n",
130+
"import string\n",
131131
"\n",
132-
"batch_endpoint_name = \"mnist-batch\"\n",
132+
"# Creating a unique endpoint name by including a random suffix\n",
133+
"allowed_chars = string.ascii_lowercase + string.digits\n",
134+
"endpoint_suffix = ''.join(random.choice(allowed_chars) for x in range(5))\n",
135+
"batch_endpoint_name = \"mnist-batch-\" + endpoint_suffix\n",
133136
"\n",
134137
"# create a batch endpoint\n",
135138
"endpoint = BatchEndpoint(\n",
@@ -313,16 +316,13 @@
313316
"description": {
314317
"description": "Create and test batch endpoint and deployement"
315318
},
316-
"interpreter": {
317-
"hash": "6407d64e10ce2bbca0b4c0db13afcc4d8f856d62941714d7dab3595b63436e00"
318-
},
319319
"kernel_info": {
320320
"name": "python3-azureml"
321321
},
322322
"kernelspec": {
323-
"display_name": "Python 3.10 - SDK V2",
323+
"display_name": "Python 3.11.0 64-bit",
324324
"language": "python",
325-
"name": "python310-sdkv2"
325+
"name": "python3"
326326
},
327327
"language_info": {
328328
"codemirror_mode": {
@@ -334,10 +334,15 @@
334334
"name": "python",
335335
"nbconvert_exporter": "python",
336336
"pygments_lexer": "ipython3",
337-
"version": "3.10.4"
337+
"version": "3.11.0"
338338
},
339339
"nteract": {
340340
"version": "[email protected]"
341+
},
342+
"vscode": {
343+
"interpreter": {
344+
"hash": "97244a77a34cba5e2b1e39283dc2fb6fff847d184db3eb48522848cc6c29e077"
345+
}
341346
}
342347
},
343348
"nbformat": 4,

0 commit comments

Comments
 (0)