diff --git a/sdk/python/foundation-models/system/finetune/chat-completion/chat-completion.ipynb b/sdk/python/foundation-models/system/finetune/chat-completion/chat-completion.ipynb index 91519584dc..2d173ced59 100644 --- a/sdk/python/foundation-models/system/finetune/chat-completion/chat-completion.ipynb +++ b/sdk/python/foundation-models/system/finetune/chat-completion/chat-completion.ipynb @@ -625,12 +625,35 @@ "metadata": {}, "outputs": [], "source": [ + "import ast\n", + "\n", + "instance_type = \"Standard_NC6s_v3\"\n", + "\n", + "# Inference compute allow list that supports deployment\n", + "if \"inference_compute_allow_list\" in foundation_model.tags:\n", + " inference_computes_allow_list = ast.literal_eval(\n", + " foundation_model.tags[\"inference_compute_allow_list\"]\n", + " ) # convert string to python list\n", + " print(f\"Please create a compute from the above list - {computes_allow_list}\")\n", + "else:\n", + " inference_computes_allow_list = None\n", + " print(\"`inference_compute_allow_list` is not part of model tags\")\n", + "\n", + "# Check if the compute is in the allow listed computes\n", + "if (\n", + " inference_computes_allow_list is not None\n", + " and instance_type not in inference_computes_allow_list\n", + "):\n", + " print(\n", + " f\"`instance_type` is not in the allow listed compute. Please select a value from {inference_computes_allow_list}\"\n", + " )\n", + "\n", "# create a deployment\n", "demo_deployment = ManagedOnlineDeployment(\n", " name=\"demo\",\n", " endpoint_name=online_endpoint_name,\n", " model=registered_model.id,\n", - " instance_type=\"Standard_E8s_v3\",\n", + " instance_type=instance_type,\n", " instance_count=1,\n", " liveness_probe=ProbeSettings(initial_delay=600),\n", " request_settings=OnlineRequestSettings(request_timeout_ms=90000),\n",