Skip to content

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mrDzurb committed Feb 22, 2025
1 parent 6689440 commit a2adbf6
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions tests/unitary/with_extras/aqua/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ def test_create_multimodel(
mock_model.display_name = "test_display_name"
mock_model.description = "test_description"
mock_model.freeform_tags = {
"OCI_AQUA": "ACTIVE",
# "OCI_AQUA": "ACTIVE",
}
mock_model.id = "mock_model_id"
mock_model.artifact = "mock_artifact_path"
Expand All @@ -391,10 +391,7 @@ def test_create_multimodel(
env_var={"params": "--trust-remote-code --max-model-len 32000"},
)

with pytest.raises(
AquaValueError,
match="Invalid selected model test_display_name. Currently only service models are supported for multi model deployment.",
):
with pytest.raises(AquaValueError):
model = self.app.create_multi(
models=[model_info_1, model_info_2],
project_id="test_project_id",
Expand All @@ -403,10 +400,7 @@ def test_create_multimodel(

mock_model.freeform_tags["aqua_service_model"] = TestDataset.SERVICE_MODEL_ID

with pytest.raises(
AquaValueError,
match="Invalid or missing task tag for selected model test_display_name. Currently only text-generation models are support for multi model deployment.",
):
with pytest.raises(AquaValueError):
model = self.app.create_multi(
models=[model_info_1, model_info_2],
project_id="test_project_id",
Expand All @@ -415,10 +409,7 @@ def test_create_multimodel(

mock_model.freeform_tags["task"] = "text-generation"

with pytest.raises(
AquaValueError,
match="Unsupported deployment container 'odsc-tgi-serving' for model 'mock_model_id'. Only 'odsc-vllm-serving' is supported for multi-model deployments.",
):
with pytest.raises(AquaValueError):
model = self.app.create_multi(
models=[model_info_1, model_info_2],
project_id="test_project_id",
Expand Down Expand Up @@ -449,7 +440,7 @@ def test_create_multimodel(
mock_from_id.return_value = mock_model
mock_create.return_value = mock_model

assert model.freeform_tags == {"OCI_AQUA": "active", "aqua_multimodel": "true"}
assert model.freeform_tags == {"aqua_multimodel": "true"}
assert model.custom_metadata_list.get("model_group_count").value == "2"
assert (
model.custom_metadata_list.get("deployment-container").value
Expand Down

0 comments on commit a2adbf6

Please sign in to comment.