Skip to content

Commit bb4e15b

Browse files
committed
check sharding + network iso pre optimization
1 parent 7e8e237 commit bb4e15b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/sagemaker/serve/builder/model_builder.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1234,6 +1234,11 @@ def _model_builder_optimize_wrapper(
12341234
Returns:
12351235
Model: A deployable ``Model`` object.
12361236
"""
1237+
if hasattr(self, "enable_network_isolation") and sharding_config:
1238+
raise ValueError(
1239+
"EnableNetworkIsolation cannot be set to True since SageMaker Fast Model "
1240+
"Loading of model requires network access."
1241+
)
12371242

12381243
# TODO: ideally these dictionaries need to be sagemaker_core shapes
12391244
# TODO: for organization, abstract all validation behind this fn

0 commit comments

Comments
 (0)