Skip to content

Commit 95e5db0

Browse files
committed
fix: pass in inference_ami_version to model_based endpoint type
1 parent 13ad978 commit 95e5db0

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/sagemaker/model.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1492,6 +1492,9 @@ def deploy(
14921492
}
14931493
model_reference_arn (Optional [str]): Hub Content Arn of a Model Reference type
14941494
content (default: None).
1495+
inference_ami_version (Optional [str]): Specifies an option from a collection of preconfigured
1496+
Amazon Machine Image (AMI) images. For a full list of options, see:
1497+
https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_ProductionVariant.html
14951498
Raises:
14961499
ValueError: If arguments combination check failed in these circumstances:
14971500
- If no role is specified or
@@ -1743,6 +1746,7 @@ def deploy(
17431746
model_data_download_timeout=model_data_download_timeout,
17441747
container_startup_health_check_timeout=container_startup_health_check_timeout,
17451748
routing_config=routing_config,
1749+
inference_ami_version=inference_ami_version,
17461750
)
17471751
if endpoint_name:
17481752
self.endpoint_name = endpoint_name

tests/unit/sagemaker/model/test_deploy.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ def test_deploy(name_from_base, prepare_container_def, production_variant, sagem
130130
model_data_download_timeout=None,
131131
container_startup_health_check_timeout=None,
132132
routing_config=None,
133+
inference_ami_version=None,
133134
)
134135

135136
sagemaker_session.create_model.assert_called_with(
@@ -192,6 +193,7 @@ def test_deploy_accelerator_type(
192193
model_data_download_timeout=None,
193194
container_startup_health_check_timeout=None,
194195
routing_config=None,
196+
inference_ami_version=None,
195197
)
196198

197199
sagemaker_session.endpoint_from_production_variants.assert_called_with(
@@ -519,6 +521,7 @@ def test_deploy_serverless_inference(production_variant, create_sagemaker_model,
519521
model_data_download_timeout=None,
520522
container_startup_health_check_timeout=None,
521523
routing_config=None,
524+
inference_ami_version=None,
522525
)
523526

524527
sagemaker_session.endpoint_from_production_variants.assert_called_with(
@@ -956,6 +959,7 @@ def test_deploy_customized_volume_size_and_timeout(
956959
model_data_download_timeout=model_data_download_timeout_sec,
957960
container_startup_health_check_timeout=startup_health_check_timeout_sec,
958961
routing_config=None,
962+
inference_ami_version=None,
959963
)
960964

961965
sagemaker_session.create_model.assert_called_with(
@@ -1006,6 +1010,7 @@ def test_deploy_with_resources(sagemaker_session, name_from_base, production_var
10061010
model_data_download_timeout=None,
10071011
container_startup_health_check_timeout=None,
10081012
routing_config=None,
1013+
inference_ami_version=None,
10091014
)
10101015
sagemaker_session.endpoint_from_production_variants.assert_called_with(
10111016
name=name_from_base(MODEL_NAME),

0 commit comments

Comments
 (0)