Skip to content

Commit eac0fa4

Browse files
committed
chore: cleanup code
1 parent 7ee71d5 commit eac0fa4

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/sagemaker/utils.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1457,12 +1457,11 @@ def volume_size_supported(instance_type: str) -> bool:
14571457
# Any instance type with a "d" in the instance family (i.e. c5d, p4d, etc)
14581458
# + g5 or g6 or p5 does not support attaching an EBS volume.
14591459
family = parts[0]
1460-
return (
1461-
"d" not in family
1462-
and not family.startswith("g5")
1463-
and not family.startswith("g6")
1464-
and not family.startswith("p5")
1465-
and not family.startswith("trn1")
1460+
1461+
unsupported_families = ["g5", "g6", "p5", "trn1"]
1462+
1463+
return "d" not in family and not any(
1464+
family.startswith(prefix) for prefix in unsupported_families
14661465
)
14671466
except Exception as e:
14681467
raise ValueError(f"Failed to parse instance type '{instance_type}': {str(e)}")

0 commit comments

Comments
 (0)