Skip to content

Commit f196331

Browse files
Formatting
1 parent 3a9fa5b commit f196331

File tree

3 files changed

+16
-11
lines changed

3 files changed

+16
-11
lines changed

ads/aqua/common/enums.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,10 @@ class InferenceContainerTypeFamily(str, metaclass=ExtendedEnumMeta):
5353
AQUA_TGI_CONTAINER_FAMILY = "odsc-tgi-serving"
5454
AQUA_LLAMA_CPP_CONTAINER_FAMILY = "odsc-llama-cpp-serving"
5555

56-
class CustomInferenceContainerTypeFamily(str,metaclass=ExtendedEnumMeta):
57-
AQUA_TEI_CONTAINER_FAMILY="odsc-tei-serving"
56+
57+
class CustomInferenceContainerTypeFamily(str, metaclass=ExtendedEnumMeta):
58+
AQUA_TEI_CONTAINER_FAMILY = "odsc-tei-serving"
59+
5860

5961
class InferenceContainerParamType(str, metaclass=ExtendedEnumMeta):
6062
PARAM_TYPE_VLLM = "VLLM_PARAMS"

ads/aqua/extension/model_handler.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
from tornado.web import HTTPError
99

1010
from ads.aqua.common.decorator import handle_exceptions
11-
from ads.aqua.common.enums import InferenceContainerTypeFamily,CustomInferenceContainerTypeFamily
11+
from ads.aqua.common.enums import (
12+
CustomInferenceContainerTypeFamily,
13+
)
1214
from ads.aqua.common.errors import AquaRuntimeError, AquaValueError
1315
from ads.aqua.common.utils import (
1416
get_hf_model_info,

ads/aqua/model/model.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@
1515
from ads.aqua import ODSC_MODEL_COMPARTMENT_OCID, logger
1616
from ads.aqua.app import AquaApp
1717
from ads.aqua.common.enums import (
18+
CustomInferenceContainerTypeFamily,
1819
FineTuningContainerTypeFamily,
1920
InferenceContainerTypeFamily,
20-
Tags, CustomInferenceContainerTypeFamily,
21+
Tags,
2122
)
2223
from ads.aqua.common.errors import AquaRuntimeError, AquaValueError
2324
from ads.aqua.common.utils import (
@@ -405,18 +406,19 @@ def edit_registered_model(
405406
if ds_model.freeform_tags.get(Tags.BASE_MODEL_CUSTOM, None):
406407
if ds_model.freeform_tags.get(Tags.AQUA_SERVICE_MODEL_TAG, None):
407408
raise AquaRuntimeError(
408-
f"Only registered unverified models can be edited."
409+
"Only registered unverified models can be edited."
409410
)
410411
else:
411412
custom_metadata_list = ds_model.custom_metadata_list
412413
freeform_tags = ds_model.freeform_tags
413414
if inference_container:
414415
if (
415-
inference_container in CustomInferenceContainerTypeFamily.values()
416+
inference_container
417+
in CustomInferenceContainerTypeFamily.values()
416418
and inference_container_uri is None
417419
):
418420
raise AquaRuntimeError(
419-
f"Inference container URI must be provided."
421+
"Inference container URI must be provided."
420422
)
421423
else:
422424
custom_metadata_list.add(
@@ -428,7 +430,8 @@ def edit_registered_model(
428430
)
429431
if inference_container_uri:
430432
if (
431-
inference_container in CustomInferenceContainerTypeFamily.values()
433+
inference_container
434+
in CustomInferenceContainerTypeFamily.values()
432435
or inference_container is None
433436
):
434437
custom_metadata_list.add(
@@ -477,9 +480,7 @@ def edit_registered_model(
477480
)
478481
AquaApp().update_model(id, update_model_details)
479482
else:
480-
raise AquaRuntimeError(
481-
f"Only registered unverified models can be edited."
482-
)
483+
raise AquaRuntimeError("Only registered unverified models can be edited.")
483484

484485
def _fetch_metric_from_metadata(
485486
self,

0 commit comments

Comments
 (0)