45
45
ModelDeploymentConfigSummary ,
46
46
ModelParams ,
47
47
)
48
+ from ads .aqua .model .enums import MultiModelSupportedTaskType
48
49
from ads .aqua .modeldeployment .utils import MultiModelDeploymentConfigLoader
49
50
from ads .model .datascience_model import DataScienceModel
50
51
from ads .model .deployment .model_deployment import ModelDeployment
@@ -276,7 +277,7 @@ class TestDataset:
276
277
"environment_configuration_type" : "OCIR_CONTAINER" ,
277
278
"environment_variables" : {
278
279
"MODEL_DEPLOY_PREDICT_ENDPOINT" : "/v1/completions" ,
279
- "MULTI_MODEL_CONFIG" : '{ "models": [{ "params": "--served-model-name model_one --tensor-parallel-size 1 --max-model-len 2096", "model_path": "models/model_one/5be6479/artifact/"}, {"params": "--served-model-name model_two --tensor-parallel-size 1 --max-model-len 2096", "model_path": "models/model_two/83e9aa1/artifact/"}, {"params": "--served-model-name model_three --tensor-parallel-size 1 --max-model-len 2096", "model_path": "models/model_three/83e9aa1/artifact/"}]}' ,
280
+ "MULTI_MODEL_CONFIG" : '{ "models": [{ "params": "--served-model-name model_one --tensor-parallel-size 1 --max-model-len 2096", "model_path": "models/model_one/5be6479/artifact/", "model_task": "text_embedding" }, {"params": "--served-model-name model_two --tensor-parallel-size 1 --max-model-len 2096", "model_path": "models/model_two/83e9aa1/artifact/", "model_task": "image_text_to_text" }, {"params": "--served-model-name model_three --tensor-parallel-size 1 --max-model-len 2096", "model_path": "models/model_three/83e9aa1/artifact/", "model_task": "code_synthesis "}]}' ,
280
281
},
281
282
"health_check_port" : 8080 ,
282
283
"image" : "dsmc://image-name:1.0.0.0" ,
@@ -486,27 +487,30 @@ class TestDataset:
486
487
"gpu_count" : 2 ,
487
488
"model_id" : "test_model_id_1" ,
488
489
"model_name" : "test_model_1" ,
490
+ "model_task" : "text_embedding" ,
489
491
"artifact_location" : "test_location_1" ,
490
492
},
491
493
{
492
494
"env_var" : {},
493
495
"gpu_count" : 2 ,
494
496
"model_id" : "test_model_id_2" ,
495
497
"model_name" : "test_model_2" ,
498
+ "model_task" : "image_text_to_text" ,
496
499
"artifact_location" : "test_location_2" ,
497
500
},
498
501
{
499
502
"env_var" : {},
500
503
"gpu_count" : 2 ,
501
504
"model_id" : "test_model_id_3" ,
502
505
"model_name" : "test_model_3" ,
506
+ "model_task" : "code_synthesis" ,
503
507
"artifact_location" : "test_location_3" ,
504
508
},
505
509
],
506
510
"model_id" : "ocid1.datasciencemodel.oc1.<region>.<OCID>" ,
507
511
"environment_variables" : {
508
512
"MODEL_DEPLOY_PREDICT_ENDPOINT" : "/v1/completions" ,
509
- "MULTI_MODEL_CONFIG" : '{ "models": [{ "params": "--served-model-name model_one --tensor-parallel-size 1 --max-model-len 2096", "model_path": "models/model_one/5be6479/artifact/"}, {"params": "--served-model-name model_two --tensor-parallel-size 1 --max-model-len 2096", "model_path": "models/model_two/83e9aa1/artifact/"}, {"params": "--served-model-name model_three --tensor-parallel-size 1 --max-model-len 2096", "model_path": "models/model_three/83e9aa1/artifact/"}]}' ,
513
+ "MULTI_MODEL_CONFIG" : '{ "models": [{ "params": "--served-model-name model_one --tensor-parallel-size 1 --max-model-len 2096", "model_path": "models/model_one/5be6479/artifact/", "model_task": "text_embedding" }, {"params": "--served-model-name model_two --tensor-parallel-size 1 --max-model-len 2096", "model_path": "models/model_two/83e9aa1/artifact/", "model_task": "image_text_to_text" }, {"params": "--served-model-name model_three --tensor-parallel-size 1 --max-model-len 2096", "model_path": "models/model_three/83e9aa1/artifact/", "model_task": "code_synthesis "}]}' ,
510
514
},
511
515
"cmd" : [],
512
516
"console_link" : "https://cloud.oracle.com/data-science/model-deployments/ocid1.datasciencemodeldeployment.oc1.<region>.<MD_OCID>?region=region-name" ,
@@ -965,20 +969,23 @@ class TestDataset:
965
969
"gpu_count" : 1 ,
966
970
"model_id" : "ocid1.compartment.oc1..<OCID>" ,
967
971
"model_name" : "model_one" ,
972
+ "model_task" : "text_embedding" ,
968
973
"artifact_location" : "artifact_location_one" ,
969
974
},
970
975
{
971
976
"env_var" : {"--test_key_two" : "test_value_two" },
972
977
"gpu_count" : 1 ,
973
978
"model_id" : "ocid1.compartment.oc1..<OCID>" ,
974
979
"model_name" : "model_two" ,
980
+ "model_task" : "image_text_to_text" ,
975
981
"artifact_location" : "artifact_location_two" ,
976
982
},
977
983
{
978
984
"env_var" : {"--test_key_three" : "test_value_three" },
979
985
"gpu_count" : 1 ,
980
986
"model_id" : "ocid1.compartment.oc1..<OCID>" ,
981
987
"model_name" : "model_three" ,
988
+ "model_task" : "code_synthesis" ,
982
989
"artifact_location" : "artifact_location_three" ,
983
990
},
984
991
]
@@ -1787,20 +1794,23 @@ def test_create_deployment_for_multi_model(
1787
1794
model_info_1 = AquaMultiModelRef (
1788
1795
model_id = "test_model_id_1" ,
1789
1796
model_name = "test_model_1" ,
1797
+ model_task = "text_embedding" ,
1790
1798
gpu_count = 2 ,
1791
1799
artifact_location = "test_location_1" ,
1792
1800
)
1793
1801
1794
1802
model_info_2 = AquaMultiModelRef (
1795
1803
model_id = "test_model_id_2" ,
1796
1804
model_name = "test_model_2" ,
1805
+ model_task = "image_text_to_text" ,
1797
1806
gpu_count = 2 ,
1798
1807
artifact_location = "test_location_2" ,
1799
1808
)
1800
1809
1801
1810
model_info_3 = AquaMultiModelRef (
1802
1811
model_id = "test_model_id_3" ,
1803
1812
model_name = "test_model_3" ,
1813
+ model_task = "code_synthesis" ,
1804
1814
gpu_count = 2 ,
1805
1815
artifact_location = "test_location_3" ,
1806
1816
)
@@ -1826,6 +1836,7 @@ def test_create_deployment_for_multi_model(
1826
1836
1827
1837
expected_attributes = set (AquaDeployment .__annotations__ .keys ())
1828
1838
actual_attributes = result .to_dict ()
1839
+
1829
1840
assert set (actual_attributes ) == set (expected_attributes ), "Attributes mismatch"
1830
1841
expected_result = copy .deepcopy (TestDataset .aqua_multi_deployment_object )
1831
1842
expected_result ["state" ] = "CREATING"
0 commit comments