From 16418df2c67c9c4d235f62eaed8780c732ffa850 Mon Sep 17 00:00:00 2001 From: Noah Luna Date: Tue, 15 Mar 2022 14:00:40 -0700 Subject: [PATCH 1/3] Changed FailedReason to FailureReason in JSON query --- sagemaker-inference-recommender/inference-recommender.ipynb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sagemaker-inference-recommender/inference-recommender.ipynb b/sagemaker-inference-recommender/inference-recommender.ipynb index a9cc1622b4..51ea9b22e1 100644 --- a/sagemaker-inference-recommender/inference-recommender.ipynb +++ b/sagemaker-inference-recommender/inference-recommender.ipynb @@ -475,7 +475,7 @@ "\n", "if inference_recommender_job[\"Status\"] == \"FAILED\":\n", " print(\"Infernece recommender job failed \")\n", - " print(\"Failed Reason: {}\".inference_recommender_job[\"FailedReason\"])\n", + " print(\"Failed Reason: {}\".inference_recommender_job[\"FailureReason\"])\n", "else:\n", " print(\"Infernece recommender job completed\")" ] @@ -601,7 +601,7 @@ "\n", "if inference_recommender_job[\"Status\"] == \"FAILED\":\n", " print(\"Infernece recommender job failed \")\n", - " print(\"Failed Reason: {}\".inference_recommender_job[\"FailedReason\"])\n", + " print(\"Failed Reason: {}\".inference_recommender_job[\"FailureReason\"])\n", "else:\n", " print(\"Infernece recommender job completed\")" ] From 986f36d4dd6222ac52e0e53765c7f809382dcac5 Mon Sep 17 00:00:00 2001 From: Noah Luna Date: Tue, 15 Mar 2022 14:01:45 -0700 Subject: [PATCH 2/3] Fixed inference typo in failure print statements --- .../inference-recommender.ipynb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sagemaker-inference-recommender/inference-recommender.ipynb b/sagemaker-inference-recommender/inference-recommender.ipynb index 51ea9b22e1..9ad1914ecf 100644 --- a/sagemaker-inference-recommender/inference-recommender.ipynb +++ b/sagemaker-inference-recommender/inference-recommender.ipynb @@ -470,14 +470,14 @@ " if inference_recommender_job[\"Status\"] in [\"COMPLETED\", \"STOPPED\", \"FAILED\"]:\n", " stopped = True\n", " else:\n", - " print(\"Infernece recommender job in progress\")\n", + " print(\"Inference recommender job in progress\")\n", " time.sleep(300)\n", "\n", "if inference_recommender_job[\"Status\"] == \"FAILED\":\n", - " print(\"Infernece recommender job failed \")\n", + " print(\"Inference recommender job failed \")\n", " print(\"Failed Reason: {}\".inference_recommender_job[\"FailureReason\"])\n", "else:\n", - " print(\"Infernece recommender job completed\")" + " print(\"Inference recommender job completed\")" ] }, { @@ -596,14 +596,14 @@ " if inference_recommender_job[\"Status\"] in [\"COMPLETED\", \"STOPPED\", \"FAILED\"]:\n", " stopped = True\n", " else:\n", - " print(\"Infernece recommender job in progress\")\n", + " print(\"Inference recommender job in progress\")\n", " time.sleep(300)\n", "\n", "if inference_recommender_job[\"Status\"] == \"FAILED\":\n", - " print(\"Infernece recommender job failed \")\n", + " print(\"Inference recommender job failed \")\n", " print(\"Failed Reason: {}\".inference_recommender_job[\"FailureReason\"])\n", "else:\n", - " print(\"Infernece recommender job completed\")" + " print(\"Inference recommender job completed\")" ] }, { From 1624be2a214cdbfd39407e638dc76c4a0604d14a Mon Sep 17 00:00:00 2001 From: Noah Luna Date: Tue, 15 Mar 2022 14:06:50 -0700 Subject: [PATCH 3/3] replaced client with inference_client --- .../inference-recommender.ipynb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sagemaker-inference-recommender/inference-recommender.ipynb b/sagemaker-inference-recommender/inference-recommender.ipynb index 9ad1914ecf..7c25789e8e 100644 --- a/sagemaker-inference-recommender/inference-recommender.ipynb +++ b/sagemaker-inference-recommender/inference-recommender.ipynb @@ -420,11 +420,11 @@ "import uuid\n", "from sagemaker import get_execution_role\n", "\n", - "client = boto3.client(\"sagemaker\", region)\n", + "inference_client = boto3.client(\"sagemaker\", region)\n", "\n", "role = get_execution_role()\n", "default_job = uuid.uuid1()\n", - "default_response = client.create_inference_recommendations_job(\n", + "default_response = inference_client.create_inference_recommendations_job(\n", " JobName=str(default_job),\n", " JobDescription=\"Job Description\",\n", " JobType=\"Default\",\n", @@ -460,11 +460,11 @@ "import pprint\n", "import pandas as pd\n", "\n", - "client = boto3.client(\"sagemaker\", region)\n", + "inference_client = boto3.client(\"sagemaker\", region)\n", "\n", "stopped = False\n", "while not stopped:\n", - " inference_recommender_job = client.describe_inference_recommendations_job(\n", + " inference_recommender_job = inference_client.describe_inference_recommendations_job(\n", " JobName=str(default_job)\n", " )\n", " if inference_recommender_job[\"Status\"] in [\"COMPLETED\", \"STOPPED\", \"FAILED\"]:\n", @@ -525,11 +525,11 @@ "import boto3\n", "import uuid\n", "\n", - "client = boto3.client(\"sagemaker\", region)\n", + "inference_client = boto3.client(\"sagemaker\", region)\n", "\n", "role = get_execution_role()\n", "advanced_job = uuid.uuid1()\n", - "advanced_response = client.create_inference_recommendations_job(\n", + "advanced_response = inference_client.create_inference_recommendations_job(\n", " JobName=str(advanced_job),\n", " JobDescription=\"JobDescription\",\n", " JobType=\"Advanced\",\n", @@ -586,11 +586,11 @@ "import pprint\n", "import pandas as pd\n", "\n", - "client = boto3.client(\"sagemaker\", region)\n", + "inference_client = boto3.client(\"sagemaker\", region)\n", "\n", "stopped = False\n", "while not stopped:\n", - " inference_recommender_job = client.describe_inference_recommendations_job(\n", + " inference_recommender_job = inference_client.describe_inference_recommendations_job(\n", " JobName=str(advanced_job)\n", " )\n", " if inference_recommender_job[\"Status\"] in [\"COMPLETED\", \"STOPPED\", \"FAILED\"]:\n",