Skip to content

Commit

Permalink
Add ContainerConfig example comment to ir notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
gwang111 committed Sep 13, 2022
1 parent 6299535 commit 75e2f36
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions sagemaker-inference-recommender/inference-recommender.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,54 @@
"sm_client.describe_model_package(ModelPackageName=model_package_arn)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Alternative Option: ContainerConfig\n",
"\n",
"If you are missing mandatory fields to create an inference recommender job in your model package version like so (this `create_model_package_input_dict` is missing `Domain`, `Task`, and `SamplePayloadUrl`):\n",
"\n",
"```\n",
"create_model_package_input_dict = {\n",
" \"ModelPackageGroupName\": model_package_group_name,\n",
" \"ModelPackageDescription\": model_package_description,\n",
" \"ModelApprovalStatus\": model_approval_status,\n",
"}\n",
"```\n",
"\n",
"You may define the fields `Domain`, `Task`, and `SamplePayloadUrl` in the optional field `ContainerConfig` like so:\n",
"\n",
"```\n",
"payload_config = {\n",
" \"SamplePayloadUrl\": sample_payload_url,\n",
"}\n",
"\n",
"container_config = {\n",
" \"Domain\": ml_domain.upper(),\n",
" \"Task\": ml_task.upper(),\n",
" \"PayloadConfig\": payload_config,\n",
"}\n",
"```\n",
"\n",
"And then provide it directly within `create_inference_recommendations_job()` API like so:\n",
"\n",
"```\n",
"default_response = client.create_inference_recommendations_job(\n",
" JobName=str(default_job),\n",
" JobDescription=\"\",\n",
" JobType=\"Default\",\n",
" RoleArn=role,\n",
" InputConfig={\n",
" \"ModelPackageVersionArn\": model_package_arn,\n",
" \"ContainerConfig\": container_config\n",
" },\n",
")\n",
"```\n",
"\n",
"For more information on what else can be provided via `ContainerConfig` please refer to the `CreateInferenceRecommendationsJob` doc here: [CreateInferenceRecommendationsJob](https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateInferenceRecommendationsJob.html)"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down

0 comments on commit 75e2f36

Please sign in to comment.