From 27e53b9895f2fd0b81e1445416f39fa4c1a9ef67 Mon Sep 17 00:00:00 2001 From: hrehard Date: Thu, 23 Jul 2026 09:37:53 -0700 Subject: [PATCH 1/2] fix: resolve Nova model artifacts via TrainingJob.get() in bedrock deploy example In bedrock-modelbuilder-deployment.ipynb, after sft_trainer.train(wait=True) the example printed sft_trainer._latest_training_job.model_artifacts.s3_model_artifacts. For Nova training jobs the DescribeTrainingJob API returns no ModelArtifacts, and the trainer's cached _latest_training_job is not re-fetched -- so model_artifacts stays Unassigned and the cell raises 'AttributeError: Unassigned object has no attribute s3_model_artifacts', halting the notebook before deploy. Re-fetch the completed job with TrainingJob.get(), which synthesizes the artifacts path from output_data_config (same pattern the earlier get() cell already uses). --- .../bedrock-modelbuilder-deployment.ipynb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/v3-examples/model-customization-examples/bedrock-modelbuilder-deployment.ipynb b/v3-examples/model-customization-examples/bedrock-modelbuilder-deployment.ipynb index b0340bf086..ec2ee884bb 100644 --- a/v3-examples/model-customization-examples/bedrock-modelbuilder-deployment.ipynb +++ b/v3-examples/model-customization-examples/bedrock-modelbuilder-deployment.ipynb @@ -164,8 +164,11 @@ "# Train and wait for completion\n", "sft_trainer.train(wait=True)\n", "\n", - "# The trainer now has model_artifacts resolved on _latest_training_job\n", - "print(f\"Checkpoint: {sft_trainer._latest_training_job.model_artifacts.s3_model_artifacts}\")" + "# Re-fetch the completed job so model_artifacts is resolved -- Nova training jobs\n", + "# don't populate it on the trainer's cached _latest_training_job (unlike the\n", + "# TrainingJob.get() cell above, get() synthesizes the artifacts path).\n", + "job = TrainingJob.get(training_job_name=sft_trainer._latest_training_job.training_job_name)\n", + "print(f\"Checkpoint: {job.model_artifacts.s3_model_artifacts}\")" ] }, { From 98dac98b34cce013a6c623c19381ef925fe62e19 Mon Sep 17 00:00:00 2001 From: hrehard Date: Thu, 23 Jul 2026 09:43:26 -0700 Subject: [PATCH 2/2] docs: shorten comment in bedrock deploy example (public notebook) --- .../bedrock-modelbuilder-deployment.ipynb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/v3-examples/model-customization-examples/bedrock-modelbuilder-deployment.ipynb b/v3-examples/model-customization-examples/bedrock-modelbuilder-deployment.ipynb index ec2ee884bb..0c2910258a 100644 --- a/v3-examples/model-customization-examples/bedrock-modelbuilder-deployment.ipynb +++ b/v3-examples/model-customization-examples/bedrock-modelbuilder-deployment.ipynb @@ -164,9 +164,7 @@ "# Train and wait for completion\n", "sft_trainer.train(wait=True)\n", "\n", - "# Re-fetch the completed job so model_artifacts is resolved -- Nova training jobs\n", - "# don't populate it on the trainer's cached _latest_training_job (unlike the\n", - "# TrainingJob.get() cell above, get() synthesizes the artifacts path).\n", + "# Fetch the completed job to read its model artifacts.\n", "job = TrainingJob.get(training_job_name=sft_trainer._latest_training_job.training_job_name)\n", "print(f\"Checkpoint: {job.model_artifacts.s3_model_artifacts}\")" ]