Skip to content

Commit f8d3d99

Browse files
Hannah14295hrehard
andauthored
fix: resolve Nova model artifacts via TrainingJob.get() in bedrock-modelbuilder-deployment example (#6091)
* 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). * docs: shorten comment in bedrock deploy example (public notebook) --------- Co-authored-by: hrehard <hrehard@amazon.com>
1 parent 25f8c57 commit f8d3d99

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,9 @@
165165
"# Train and wait for completion\n",
166166
"sft_trainer.train(wait=True)\n",
167167
"\n",
168-
"# The trainer now has model_artifacts resolved on _latest_training_job\n",
169-
"print(f\"Checkpoint: {sft_trainer._latest_training_job.model_artifacts.s3_model_artifacts}\")"
168+
"# Fetch the completed job to read its model artifacts.\n",
169+
"job = TrainingJob.get(training_job_name=sft_trainer._latest_training_job.training_job_name)\n",
170+
"print(f\"Checkpoint: {job.model_artifacts.s3_model_artifacts}\")"
170171
]
171172
},
172173
{

0 commit comments

Comments
 (0)