Skip to content

Commit d48c70d

Browse files
committed
Updated pr.
1 parent 5f8dcac commit d48c70d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

ads/aqua/modeldeployment/entities.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from ads.aqua.common.entities import AquaMultiModelRef, LoraModuleSpec
1212
from ads.aqua.common.enums import Tags
1313
from ads.aqua.common.errors import AquaValueError
14+
from ads.aqua.common.utils import is_valid_ocid
1415
from ads.aqua.config.utils.serializer import Serializable
1516
from ads.aqua.constants import (
1617
AQUA_FINE_TUNE_MODEL_VERSION,
@@ -730,6 +731,11 @@ def validate_base_model(self, model_id: str) -> Union[str, AquaMultiModelRef]:
730731
model_id : str
731732
The OCID of DataScienceModel instance.
732733
734+
Returns
735+
-------
736+
Union[str, AquaMultiModelRef]
737+
A string of model id or an instance of AquaMultiModelRef.
738+
733739
Raises
734740
------
735741
ConfigValidationError
@@ -751,7 +757,7 @@ def validate_base_model(self, model_id: str) -> Union[str, AquaMultiModelRef]:
751757
f"Detected base model is fine-tuned model {AQUA_FINE_TUNE_MODEL_VERSION} and switched to stack deployment."
752758
)
753759
segments = aqua_fine_tuned_model.split("#")
754-
if len(segments) != 2:
760+
if not segments or not is_valid_ocid(segments[0]):
755761
logger.error(
756762
"Validation failed: Fine-tuned model ID '%s' is not supported for model deployment.",
757763
base_model.id,

0 commit comments

Comments
 (0)