Skip to content

Commit 3a431fa

Browse files
committed
fixed formatting
1 parent 96f5543 commit 3a431fa

File tree

3 files changed

+24
-22
lines changed

3 files changed

+24
-22
lines changed

ads/aqua/modeldeployment/deployment.py

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,11 @@
6464
ModelDeploymentConfigSummary,
6565
MultiModelDeploymentConfigLoader,
6666
)
67-
from ads.aqua.modeldeployment.constants import DEFAULT_POLL_INTERVAL, DEFAULT_WAIT_TIME, SHAPE_MAP
67+
from ads.aqua.modeldeployment.constants import (
68+
DEFAULT_POLL_INTERVAL,
69+
DEFAULT_WAIT_TIME,
70+
SHAPE_MAP,
71+
)
6872
from ads.aqua.modeldeployment.entities import (
6973
AquaDeployment,
7074
AquaDeploymentDetail,
@@ -1282,28 +1286,25 @@ def valid_compute_shapes(self, **kwargs) -> List["ComputeShapeSummary"]:
12821286
oci_shape = set_user_shapes.get(name)
12831287

12841288
compute_shape = ComputeShapeSummary(
1285-
available=True,
1286-
core_count= oci_shape.core_count,
1287-
memory_in_gbs= oci_shape.memory_in_gbs,
1288-
shape_series= SHAPE_MAP.get(oci_shape.shape_series, "GPU"),
1289-
name= oci_shape.name,
1290-
gpu_specs= spec
1291-
)
1289+
available=True,
1290+
core_count=oci_shape.core_count,
1291+
memory_in_gbs=oci_shape.memory_in_gbs,
1292+
shape_series=SHAPE_MAP.get(oci_shape.shape_series, "GPU"),
1293+
name=oci_shape.name,
1294+
gpu_specs=spec,
1295+
)
12921296
else:
12931297
compute_shape = ComputeShapeSummary(
1294-
available=False, name=name, shape_series="GPU", gpu_specs=spec
1295-
)
1298+
available=False, name=name, shape_series="GPU", gpu_specs=spec
1299+
)
12961300
valid_shapes.append(compute_shape)
12971301

12981302
valid_shapes.sort(
12991303
key=lambda shape: shape.gpu_specs.gpu_memory_in_gbs, reverse=True
13001304
)
13011305
return valid_shapes
13021306

1303-
1304-
def recommend_shape(
1305-
self, **kwargs
1306-
) -> Union[Table, ShapeRecommendationReport]:
1307+
def recommend_shape(self, **kwargs) -> Union[Table, ShapeRecommendationReport]:
13071308
"""
13081309
For the CLI (set generate_table = True), generates the table (in rich diff) with valid
13091310
GPU deployment shapes for the provided model and configuration.
@@ -1334,9 +1335,6 @@ def recommend_shape(
13341335
AquaValueError
13351336
If model type is unsupported by tool (no recommendation report generated)
13361337
"""
1337-
# generate_table = kwargs.pop(
1338-
# "generate_table", True
1339-
# ) # Generate rich diff table by default
13401338
compartment_id = kwargs.get("compartment_id", COMPARTMENT_OCID)
13411339

13421340
kwargs["shapes"] = self.valid_compute_shapes(compartment_id=compartment_id)

ads/aqua/shaperecommend/recommend.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,9 @@ def which_shapes(self, **kwargs) -> Union[ShapeRecommendationReport, Table]:
9090
)
9191

9292
if request.generate_table and shape_recommendation_report.recommendations:
93-
shape_recommendation_report = self._rich_diff_table(shape_recommendation_report)
94-
93+
shape_recommendation_report = self._rich_diff_table(
94+
shape_recommendation_report
95+
)
9596

9697
# custom error to catch model incompatibility issues
9798
except AquaRecommendationError as error:

ads/aqua/shaperecommend/shape_report.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,12 @@ class RequestRecommend(BaseModel):
2323
shapes: List[ComputeShapeSummary] = Field(
2424
..., description="The list of shapes on OCI."
2525
)
26-
generate_table : Optional[bool] = Field(
27-
True, description="True - to generate the rich diff Table, False - generate the JSON response"
28-
),
26+
generate_table: Optional[bool] = (
27+
Field(
28+
True,
29+
description="True - to generate the rich diff Table, False - generate the JSON response",
30+
),
31+
)
2932
compartment_id: Optional[str] = Field(
3033
COMPARTMENT_OCID, description="The OCID of user's compartment"
3134
)

0 commit comments

Comments
 (0)