|
38 | 38 | generate_tei_cmd_var, |
39 | 39 | get_artifact_path, |
40 | 40 | get_hf_model_info, |
| 41 | + get_preferred_compatible_family, |
41 | 42 | list_os_files_with_extension, |
42 | 43 | load_config, |
43 | 44 | upload_folder, |
@@ -340,15 +341,25 @@ def create_multi( |
340 | 341 |
|
341 | 342 | selected_models_deployment_containers.add(deployment_container) |
342 | 343 |
|
343 | | - # Check if the all models in the group shares same container family |
344 | | - if len(selected_models_deployment_containers) > 1: |
| 344 | + if not selected_models_deployment_containers: |
345 | 345 | raise AquaValueError( |
346 | | - "The selected models are associated with different container families: " |
347 | | - f"{list(selected_models_deployment_containers)}." |
348 | | - "For multi-model deployment, all models in the group must share the same container family." |
| 346 | + "None of the selected models are associated with a recognized container family. " |
| 347 | + "Please review the selected models, or select a different group of models." |
349 | 348 | ) |
350 | 349 |
|
351 | | - deployment_container = selected_models_deployment_containers.pop() |
| 350 | + # Check if the all models in the group shares same container family |
| 351 | + if len(selected_models_deployment_containers) > 1: |
| 352 | + deployment_container = get_preferred_compatible_family( |
| 353 | + selected_families=selected_models_deployment_containers |
| 354 | + ) |
| 355 | + if not deployment_container: |
| 356 | + raise AquaValueError( |
| 357 | + "The selected models are associated with different container families: " |
| 358 | + f"{list(selected_models_deployment_containers)}." |
| 359 | + "For multi-model deployment, all models in the group must share the same container family." |
| 360 | + ) |
| 361 | + else: |
| 362 | + deployment_container = selected_models_deployment_containers.pop() |
352 | 363 |
|
353 | 364 | # Generate model group details |
354 | 365 | timestamp = datetime.now().strftime("%Y%m%d") |
|
0 commit comments