Skip to content

Commit

Permalink
update vision notebook with serverless
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaheli Chattopadhyay committed Sep 26, 2023
1 parent e9470ab commit a364583
Showing 1 changed file with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -565,13 +565,13 @@
"\n",
"import random\n",
"import string\n",
"from azure.ai.ml.entities import ResourceConfiguration \n",
"\n",
"allowed_chars = string.ascii_lowercase + string.digits\n",
"suffix = \"\".join(random.choice(allowed_chars) for x in range(5))\n",
"job_name = \"dpv2-image-classification-job-02\" + suffix\n",
"\n",
"image_classification_job = automl.image_classification(\n",
" # compute=train_compute_name,\n",
" name=job_name,\n",
" experiment_name=exp_name,\n",
" training_data=my_training_data_input,\n",
Expand All @@ -584,7 +584,10 @@
"image_classification_job.set_limits(\n",
" max_trials=10,\n",
" max_concurrent_trials=2,\n",
")"
")\n",
"\n",
"# Serverless compute resources used to run the job\n",
"image_classification_job.resources = ResourceConfiguration(instance_type=\"Standard_NC6s_v3\")"
]
},
{
Expand Down Expand Up @@ -996,7 +999,6 @@
"\n",
"\n",
"@dsl.pipeline(\n",
" compute=rai_compute_name,\n",
" description=\"Example RAI computation on Fridge data\",\n",
" experiment_name=f\"RAI_Fridge_Example_RAIInsights_Computation\",\n",
")\n",
Expand Down Expand Up @@ -1064,7 +1066,10 @@
" path=f\"azureml://datastores/workspaceblobstore/paths/{rand_path}/ux_json/\",\n",
" mode=\"upload\",\n",
" type=\"uri_folder\",\n",
")"
")\n",
"\n",
"# set pipeline to use serverless compute\n",
"insights_pipeline_job.default_compute = \"serverless\""
]
},
{
Expand Down Expand Up @@ -1271,9 +1276,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3.10 - SDK V2",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python310-sdkv2"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -1285,7 +1290,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.15"
"version": "3.11.4"
}
},
"nbformat": 4,
Expand Down

0 comments on commit a364583

Please sign in to comment.