Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ignore validation flag while registering model #1023

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions ads/aqua/model/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@
InferenceContainerTypeFamily,
Tags,
)
from ads.aqua.common.errors import AquaRuntimeError, AquaValueError
from ads.aqua.common.errors import (
AquaFileNotFoundError,
AquaRuntimeError,
AquaValueError,
)
from ads.aqua.common.utils import (
LifecycleStatus,
_build_resource_identifier,
Expand Down Expand Up @@ -1206,7 +1210,9 @@ def _validate_safetensor_format(
except Exception as ex:
logger.error(
f"Exception occurred while loading config file from {import_model_details.os_path}"
f"Exception message: {ex}"
)
logger.error(
VipulMascarenhas marked this conversation as resolved.
Show resolved Hide resolved
ex.reason if isinstance(ex, AquaFileNotFoundError) else str(ex)
)
if not import_model_details.ignore_model_artifact_check:
raise AquaRuntimeError(
Expand Down
10 changes: 8 additions & 2 deletions tests/unitary/with_extras/aqua/test_model_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def test_list(self, mock_list):

@parameterized.expand(
[
(None, None, False, None, None, None, None, None),
(None, None, False, None, None, None, None, None, True),
(
"odsc-llm-fine-tuning",
None,
Expand All @@ -142,8 +142,9 @@ def test_list(self, mock_list):
["test.json"],
None,
None,
False,
),
(None, "test.gguf", True, None, ["*.json"], None, None, None),
(None, "test.gguf", True, None, ["*.json"], None, None, None, False),
(
None,
None,
Expand All @@ -153,6 +154,7 @@ def test_list(self, mock_list):
["test.json"],
None,
None,
False,
),
(
None,
Expand All @@ -163,6 +165,7 @@ def test_list(self, mock_list):
None,
{"ftag1": "fvalue1"},
{"dtag1": "dvalue1"},
False,
),
],
)
Expand All @@ -178,6 +181,7 @@ def test_register(
ignore_patterns,
freeform_tags,
defined_tags,
ignore_model_artifact_check,
mock_register,
mock_finish,
):
Expand All @@ -201,6 +205,7 @@ def test_register(
ignore_patterns=ignore_patterns,
freeform_tags=freeform_tags,
defined_tags=defined_tags,
ignore_model_artifact_check=ignore_model_artifact_check,
)
)
result = self.model_handler.post()
Expand All @@ -218,6 +223,7 @@ def test_register(
ignore_patterns=ignore_patterns,
freeform_tags=freeform_tags,
defined_tags=defined_tags,
ignore_model_artifact_check=ignore_model_artifact_check,
)
assert result["id"] == "test_id"
assert result["inference_container"] == "odsc-tgi-serving"
Expand Down
Loading