Skip to content

Commit e9682e6

Browse files
author
hrehard
committed
fix(examples): make Bedrock model-import job name unique per run
The OSS-import path in bedrock-modelbuilder-deployment.ipynb hardcoded job_name="import-llama-finetuned" and imported_model_name="llama-3-8b-finetuned". Bedrock's CreateModelImportJob requires a unique job name, and completed import jobs cannot be deleted, so running the notebook a second time in the same account/region fails with "The provided job name is currently in use." Append an int(time.time()) suffix to both names so the example is repeatable. time is already imported in the notebook.
1 parent 3f810c6 commit e9682e6

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎v3-examples/model-customization-examples/bedrock-modelbuilder-deployment.ipynb‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,12 @@
124124
"# OSS path: omit custom_model_name to use create_model_import_job API\n",
125125
"builder_oss = BedrockModelBuilder(model=\"s3://my-bucket/models/llama-3-8b-finetuned/\")\n",
126126
"\n",
127+
"# Import job and model names must be unique per account/region; import jobs\n",
128+
"# cannot be deleted, so add a timestamp suffix to keep this example repeatable.\n",
129+
"suffix = int(time.time())\n",
127130
"result = builder_oss.deploy(\n",
128-
" job_name=\"import-llama-finetuned\",\n",
129-
" imported_model_name=\"llama-3-8b-finetuned\",\n",
131+
" job_name=f\"import-llama-finetuned-{suffix}\",\n",
132+
" imported_model_name=f\"llama-3-8b-finetuned-{suffix}\",\n",
130133
" role_arn=ROLE_ARN,\n",
131134
")\n",
132135
"print(f\"Model ARN: {result.get('importedModelArn')}\")\n",

0 commit comments

Comments
 (0)