@@ -511,28 +511,34 @@ def validate_input_models(self, model_details: Dict[str, DataScienceModel]) -> N
511511
512512 if not base_model :
513513 logger .error (
514- "Validation failed: Base model ID '%s' not found." , base_model_id
514+ "Validation failed: Base model '%s' (id: '%s') not found." ,
515+ model .model_name ,
516+ base_model_id ,
517+ )
518+ raise ConfigValidationError (
519+ f"Model not found: '{ model .model_name } ' (id: '{ base_model_id } ')."
515520 )
516- raise ConfigValidationError (f"Model not found: '{ base_model_id } '." )
517521
518522 if Tags .AQUA_FINE_TUNED_MODEL_TAG in (base_model .freeform_tags or {}):
519523 logger .error (
520- "Validation failed: Base model ID '%s' is a fine-tuned model." ,
524+ "Validation failed: Base model '%s' (id: '%s') is a fine-tuned model." ,
525+ base_model .display_name ,
521526 base_model_id ,
522527 )
523528 raise ConfigValidationError (
524- f"Invalid base model ID '{ base_model_id } '. "
529+ f"Invalid base model ' { base_model . display_name } ' (id: '{ base_model_id } ') . "
525530 "Specify a base model OCID in the `models` input, not a fine-tuned model."
526531 )
527532
528533 if base_model .lifecycle_state != "ACTIVE" :
529534 logger .error (
530- "Validation failed: Base model '%s' is in state '%s'." ,
535+ "Validation failed: Base model '%s' (id: '%s') is in state '%s'." ,
536+ base_model .display_name ,
531537 base_model_id ,
532538 base_model .lifecycle_state ,
533539 )
534540 raise ConfigValidationError (
535- f"Invalid base model ID '{ base_model_id } ': must be in ACTIVE state."
541+ f"Invalid base model ' { base_model . display_name } ' (id: '{ base_model_id } ') : must be in ACTIVE state."
536542 )
537543
538544 # Normalize and validate model name uniqueness
@@ -548,31 +554,34 @@ def validate_input_models(self, model_details: Dict[str, DataScienceModel]) -> N
548554
549555 if not ft_model :
550556 logger .error (
551- "Validation failed: Fine-tuned model ID '%s' not found." ,
557+ "Validation failed: Fine-tuned model '%s' (id: '%s') not found." ,
558+ lora_module .model_name ,
552559 ft_model_id ,
553560 )
554561 raise ConfigValidationError (
555- f"Fine-tuned model not found: '{ ft_model_id } '."
562+ f"Fine-tuned model not found: '{ lora_module . model_name } ' (id: ' { ft_model_id } ') ."
556563 )
557564
558565 if ft_model .lifecycle_state != "ACTIVE" :
559566 logger .error (
560- "Validation failed: Fine-tuned model '%s' is in state '%s'." ,
567+ "Validation failed: Fine-tuned model '%s' (id: '%s') is in state '%s'." ,
568+ ft_model .display_name ,
561569 ft_model_id ,
562570 ft_model .lifecycle_state ,
563571 )
564572 raise ConfigValidationError (
565- f"Invalid Fine-tuned model ID '{ ft_model_id } ': must be in ACTIVE state."
573+ f"Invalid Fine-tuned model ' { ft_model . display_name } ' (id: '{ ft_model_id } ') : must be in ACTIVE state."
566574 )
567575
568576 if Tags .AQUA_FINE_TUNED_MODEL_TAG not in (ft_model .freeform_tags or {}):
569577 logger .error (
570- "Validation failed: Model ID '%s' is missing tag '%s'." ,
578+ "Validation failed: Model '%s' (id: '%s') is missing tag '%s'." ,
579+ ft_model .display_name ,
571580 ft_model_id ,
572581 Tags .AQUA_FINE_TUNED_MODEL_TAG ,
573582 )
574583 raise ConfigValidationError (
575- f"Invalid fine-tuned model ID '{ ft_model_id } ': missing tag '{ Tags .AQUA_FINE_TUNED_MODEL_TAG } '."
584+ f"Invalid fine-tuned model ' { ft_model . display_name } ' (id: '{ ft_model_id } ') : missing tag '{ Tags .AQUA_FINE_TUNED_MODEL_TAG } '."
576585 )
577586
578587 self .validate_ft_model_v2 (model = ft_model )
@@ -586,14 +595,16 @@ def validate_input_models(self, model_details: Dict[str, DataScienceModel]) -> N
586595
587596 if ft_base_model_id != base_model_id :
588597 logger .error (
589- "Validation failed: Fine-tuned model '%s' is linked to base model '%s' (expected '%s')." ,
598+ "Validation failed: Fine-tuned model '%s' (id: '%s') is linked to base model '%s' (expected '%s' with id: '%s')." ,
599+ ft_model .display_name ,
590600 ft_model_id ,
591601 ft_base_model_id ,
602+ base_model .display_name ,
592603 base_model_id ,
593604 )
594605 raise ConfigValidationError (
595- f"Fine-tuned model '{ ft_model_id } ' belongs to base model '{ ft_base_model_id } ', "
596- f"but was included under base model '{ base_model_id } '."
606+ f"Fine-tuned model '{ ft_model . display_name } ' (id: ' { ft_model_id } ') belongs to base model '{ ft_base_model_id } ', "
607+ f"but was included under base model '{ base_model . display_name } ' (id: ' { base_model_id } ') ."
597608 )
598609
599610 # Validate fine-tuned model name uniqueness
@@ -604,8 +615,10 @@ def validate_input_models(self, model_details: Dict[str, DataScienceModel]) -> N
604615 seen_names .add (lora_model_name )
605616
606617 logger .debug (
607- "Validated fine-tuned model '%s' under base model '%s'." ,
618+ "Validated fine-tuned model '%s' (id: '%s') under base model '%s' (id: '%s')." ,
619+ ft_model .display_name ,
608620 ft_model_id ,
621+ base_model .display_name ,
609622 base_model_id ,
610623 )
611624
@@ -649,11 +662,12 @@ def validate_ft_model_v2(
649662 != AQUA_FINE_TUNE_MODEL_VERSION
650663 ):
651664 logger .error (
652- "Validation failed: Fine-tuned model ID '%s' is not supported for model deployment." ,
665+ "Validation failed: Fine-tuned model '%s' (id: '%s') is not supported for model deployment." ,
666+ base_model .display_name ,
653667 base_model .id ,
654668 )
655669 raise ConfigValidationError (
656- f"Invalid fine-tuned model ID '{ base_model .id } ': only fine tune model { AQUA_FINE_TUNE_MODEL_VERSION } is supported for model deployment. "
670+ f"Invalid fine-tuned model ' { base_model . display_name } ' (id: '{ base_model .id } ') : only fine tune model { AQUA_FINE_TUNE_MODEL_VERSION } is supported for model deployment. "
657671 f"Run 'ads aqua model convert_fine_tune --model_id { base_model .id } ' to convert legacy AQUA fine tuned model to version { AQUA_FINE_TUNE_MODEL_VERSION } for deployment."
658672 )
659673
@@ -666,11 +680,12 @@ def validate_ft_model_v2(
666680
667681 if include_base_model_artifact == INCLUDE_BASE_MODEL :
668682 logger .error (
669- "Validation failed: Fine-tuned model ID '%s' is not supported for model deployment." ,
683+ "Validation failed: Fine-tuned model '%s' (id: '%s') is not supported for model deployment." ,
684+ base_model .display_name ,
670685 base_model .id ,
671686 )
672687 raise ConfigValidationError (
673- f"Invalid fine-tuned model ID '{ base_model .id } ': for fine tuned models like Phi4, the deployment is not supported. "
688+ f"Invalid fine-tuned model ' { base_model . display_name } ' (id: '{ base_model .id } ') : for fine tuned models like Phi4, the deployment is not supported. "
674689 )
675690
676691 def validate_base_model (self , model_id : str ) -> Union [str , AquaMultiModelRef ]:
@@ -714,11 +729,12 @@ def validate_base_model(self, model_id: str) -> Union[str, AquaMultiModelRef]:
714729 segments = aqua_fine_tuned_model .split ("#" )
715730 if not segments or not is_valid_ocid (segments [0 ]):
716731 logger .error (
717- "Validation failed: Fine-tuned model ID '%s' is not supported for model deployment." ,
732+ "Validation failed: Fine-tuned model '%s' (id: '%s') is not supported for model deployment." ,
733+ base_model .display_name ,
718734 base_model .id ,
719735 )
720736 raise ConfigValidationError (
721- f"Invalid fine-tuned model ID '{ base_model .id } ': missing or invalid tag '{ Tags .AQUA_FINE_TUNED_MODEL_TAG } ' format. "
737+ f"Invalid fine-tuned model ' { base_model . display_name } ' (id: '{ base_model .id } ') : missing or invalid tag '{ Tags .AQUA_FINE_TUNED_MODEL_TAG } ' format. "
722738 f"Make sure tag '{ Tags .AQUA_FINE_TUNED_MODEL_TAG } ' is added with format <service_model_id>#<service_model_name>."
723739 )
724740 # reset the model_id and models in create_model_deployment_details for stack deployment
0 commit comments