Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inference recommender fix typos #3226

Merged
merged 4 commits into from
Oct 3, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 27 additions & 13 deletions sagemaker-inference-recommender/inference-recommender.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -676,11 +676,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=\"\",\n",
" JobType=\"Default\",\n",
Expand Down Expand Up @@ -721,20 +721,22 @@
"import pprint\n",
"import pandas as pd\n",
"\n",
"finished = False\n",
"while not finished:\n",
" inference_recommender_job = sm_client.describe_inference_recommendations_job(\n",
"inference_client = boto3.client(\"sagemaker\", region)\n",
"\n",
"stopped = False\n",
"while not stopped:\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",
" finished = True\n",
" else:\n",
" print(\"In progress\")\n",
" print(\"Inference recommender job in progress\")\n",
" time.sleep(300)\n",
"\n",
"if inference_recommender_job[\"Status\"] == \"FAILED\":\n",
" print(\"Inference recommender job failed \")\n",
" print(\"Failed Reason: {}\".format(inference_recommender_job[\"FailureReason\"]))\n",
" print(\"Failed Reason: {}\".inference_recommender_job[\"FailureReason\"])\n",
"else:\n",
" print(\"Inference recommender job completed\")"
]
Expand Down Expand Up @@ -793,9 +795,14 @@
"metadata": {},
"outputs": [],
"source": [
"import boto3\n",
"import uuid\n",
"\n",
"inference_client = boto3.client(\"sagemaker\", region)\n",
"\n",
"role = get_execution_role()\n",
"advanced_job = uuid.uuid1()\n",
"advanced_response = sm_client.create_inference_recommendations_job(\n",
"advanced_response = inference_client.create_inference_recommendations_job(\n",
" JobName=str(advanced_job),\n",
" JobDescription=\"\",\n",
" JobType=\"Advanced\",\n",
Expand Down Expand Up @@ -841,20 +848,27 @@
"metadata": {},
"outputs": [],
"source": [
"finished = False\n",
"while not finished:\n",
" inference_recommender_job = sm_client.describe_inference_recommendations_job(\n",
"import boto3\n",
"import uuid\n",
"import pprint\n",
"import pandas as pd\n",
"\n",
"inference_client = boto3.client(\"sagemaker\", region)\n",
"\n",
"stopped = False\n",
"while not stopped:\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",
" finished = True\n",
" else:\n",
" print(\"In progress\")\n",
" print(\"Inference recommender job in progress\")\n",
" time.sleep(300)\n",
"\n",
"if inference_recommender_job[\"Status\"] == \"FAILED\":\n",
" print(\"Inference recommender job failed \")\n",
" print(\"Failed Reason: {}\".format(inference_recommender_job[\"FailureReason\"]))\n",
" print(\"Failed Reason: {}\".inference_recommender_job[\"FailureReason\"])\n",
"else:\n",
" print(\"Inference recommender job completed\")"
]
Expand Down