Skip to content

Commit 299aec1

Browse files
Fixed bug in _create_training_details
Fixed bug in _create_training_details that would throw error "KeyError: 'HyperParameters'" if the training job did have any as a parameter hyper parameters when the CreateTrainingJob API is called.
1 parent 16d1556 commit 299aec1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/sagemaker/model_card/model_card.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -957,7 +957,9 @@ def _create_training_details(training_job_data: dict, cls: "TrainingDetails", **
957957
"hyper_parameters": [
958958
HyperParameter(key, value)
959959
for key, value in training_job_data["HyperParameters"].items()
960-
],
960+
]
961+
if "HyperParameters" in training_job_data
962+
else [],
961963
}
962964
kwargs.update({"training_job_details": TrainingJobDetails(**job)})
963965
instance = cls(**kwargs)

0 commit comments

Comments
 (0)