Skip to content

Commit 01d4401

Browse files
author
Shibo Xing
committed
style: format _validate_instance_deprecation using black
1 parent f9c449a commit 01d4401

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

src/sagemaker/image_uris.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -365,15 +365,19 @@ def _config_for_framework_and_scope(framework, image_scope, accelerator_type=Non
365365
_validate_arg(image_scope, available_scopes, "image scope")
366366
return config if "scope" in config else config[image_scope]
367367

368+
368369
def _validate_instance_deprecation(framework, instance_type, version):
369-
if framework == "pytorch" and \
370-
_get_instance_type_family(instance_type) == "p2" and \
371-
version >= "1.13":
372-
raise ValueError(
373-
"P2 instances have been deprecated for Sagemaker for PyTorch 1.13 and above. "
374-
"For information about supported instance types please refer to "
375-
"https://docs.aws.amazon.com/sagemaker/latest/dg/notebooks-available-instance-types.html"
376-
)
370+
if (
371+
framework == "pytorch"
372+
and _get_instance_type_family(instance_type) == "p2"
373+
and version >= "1.13"
374+
):
375+
raise ValueError(
376+
"P2 instances have been deprecated for Sagemaker for PyTorch 1.13 and above. "
377+
"For information about supported instance types please refer to "
378+
"https://docs.aws.amazon.com/sagemaker/latest/dg/notebooks-available-instance-types.html"
379+
)
380+
377381

378382
def _validate_for_suppported_frameworks_and_instance_type(framework, instace_type):
379383
"""Validate if framework is supported for the instance_type"""

0 commit comments

Comments
 (0)