@@ -337,6 +337,11 @@ def create_multi(
337
337
"Please register the model with a file description."
338
338
)
339
339
340
+ # Track model file description in a validated structure
341
+ model_file_description_list .append (
342
+ ModelFileDescription (** model_file_description )
343
+ )
344
+
340
345
# Ensure base model has a valid artifact
341
346
if not source_model .artifact :
342
347
logger .error (
@@ -362,11 +367,6 @@ def create_multi(
362
367
# Extract model task metadata from source model
363
368
self ._extract_model_task (model , source_model )
364
369
365
- # Track model file description in a validated structure
366
- model_file_description_list .append (
367
- ModelFileDescription (** model_file_description )
368
- )
369
-
370
370
# Process fine-tuned weights if provided
371
371
for ft_model in model .fine_tune_weights or []:
372
372
fine_tune_source_model : DataScienceModel = source_models .get (
@@ -381,6 +381,26 @@ def create_multi(
381
381
f"Unable to retrieve metadata for fine-tuned model ID: { ft_model .model_id } ."
382
382
)
383
383
384
+ # Validate model file description
385
+ ft_model_file_description = (
386
+ fine_tune_source_model .model_file_description
387
+ )
388
+ if not ft_model_file_description :
389
+ logger .error (
390
+ "Model '%s' (%s) has no file description." ,
391
+ fine_tune_source_model .display_name ,
392
+ ft_model .model_id ,
393
+ )
394
+ raise AquaValueError (
395
+ f"Model '{ fine_tune_source_model .display_name } ' (ID: { ft_model .model_id } ) has no file description. "
396
+ "Please register the model with a file description."
397
+ )
398
+
399
+ # Track model file description in a validated structure
400
+ model_file_description_list .append (
401
+ ModelFileDescription (** ft_model_file_description )
402
+ )
403
+
384
404
# Extract fine-tuned model path
385
405
_ , fine_tune_path = extract_fine_tune_artifacts_path (
386
406
fine_tune_source_model
0 commit comments