Skip to content

Commit 839229f

Browse files
authored
Merge branch 'main' into ODSC-77601/retrain-forecast-models
2 parents f051480 + 0fb5724 commit 839229f

File tree

5 files changed

+96
-5
lines changed

5 files changed

+96
-5
lines changed

ads/aqua/model/model.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1111,6 +1111,11 @@ def list(
11111111
aqua_models = []
11121112
inference_containers = self.get_container_config().to_dict().get("inference")
11131113
for model in models:
1114+
# Skip models without required tags early
1115+
freeform_tags = model.freeform_tags or {}
1116+
if Tags.AQUA_TAG.lower() not in {tag.lower() for tag in freeform_tags}:
1117+
continue
1118+
11141119
aqua_models.append(
11151120
AquaModelSummary(
11161121
**self._process_model(
@@ -1121,6 +1126,8 @@ def list(
11211126
project_id=project_id or UNKNOWN,
11221127
)
11231128
)
1129+
1130+
# Adds service models to cache
11241131
if category == SERVICE:
11251132
self._service_models_cache.__setitem__(
11261133
key=AQUA_SERVICE_MODELS, value=aqua_models

docs/source/release_notes.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
Release Notes
33
=============
44

5+
2.13.21
6+
-------
7+
Release date: Oct 23, 2025
8+
* Support editing multi-model deployment.
9+
* AI Quick Actions fixes and enhancements.
10+
11+
512
2.13.20
613
-------
714
Release date: Sep 29, 2025

pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ build-backend = "flit_core.buildapi"
2121

2222
# Required
2323
name = "oracle_ads" # the install (PyPI) name; name for local build in [tool.flit.module] section below
24-
version = "2.13.20"
24+
version = "2.13.21"
2525

2626
# Optional
2727
description = "Oracle Accelerated Data Science SDK"
@@ -229,7 +229,8 @@ aqua = [
229229
"cachetools",
230230
"huggingface_hub",
231231
"python-dotenv",
232-
"rich"
232+
"rich",
233+
"openai==1.109.1"
233234
]
234235

235236
# To reduce backtracking (decrese deps install time) during test/dev env setup reducing number of versions pip is

tests/unitary/with_extras/aqua/test_model.py

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1654,3 +1654,44 @@ def test_build_search_text(self, description, tags, expected_output):
16541654
self.app._build_search_text(tags=tags, description=description)
16551655
== expected_output
16561656
)
1657+
1658+
@pytest.mark.parametrize(
1659+
"remove_indices, expected_len",
1660+
[
1661+
([], 2), # All models have AQUA_TAG -> include both
1662+
([1], 1), # Second model missing AQUA_TAG -> include first only
1663+
([0, 1], 0), # Both missing AQUA_TAG -> include none
1664+
],
1665+
)
1666+
@patch.object(AquaApp, "get_container_config")
1667+
def test_list_service_models_filters_missing_aqua_tag(
1668+
self,
1669+
mock_get_container_config,
1670+
remove_indices,
1671+
expected_len,
1672+
):
1673+
"""Ensure list() excludes models that do not have AQUA_TAG in freeform_tags."""
1674+
mock_get_container_config.return_value = get_container_config()
1675+
1676+
import copy
1677+
1678+
items = copy.deepcopy(TestDataset.model_summary_objects)
1679+
for idx in remove_indices:
1680+
# remove AQUA tag entirely to validate filter behavior
1681+
items[idx]["freeform_tags"].pop("OCI_AQUA", None)
1682+
1683+
self.app.list_resource = MagicMock(
1684+
return_value=[
1685+
oci.data_science.models.ModelSummary(**item) for item in items
1686+
]
1687+
)
1688+
1689+
# Clear service models cache
1690+
self.app.clear_model_list_cache()
1691+
1692+
results = self.app.list(
1693+
compartment_id=TestDataset.SERVICE_COMPARTMENT_ID,
1694+
category=ads.config.SERVICE,
1695+
)
1696+
1697+
assert len(results) == expected_len

tests/unitary/with_extras/model/test_model_framework_pytorch_model.py

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
#!/usr/bin/env python
22

3-
# Copyright (c) 2021, 2023 Oracle and/or its affiliates.
3+
# Copyright (c) 2021, 2025 Oracle and/or its affiliates.
44
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
55

66
"""Unit tests for model frameworks. Includes tests for:
7-
- PyTorchModel
7+
- PyTorchModel
88
"""
9+
910
import base64
1011
import os
1112
import shutil
13+
import uuid
1214
from io import BytesIO
1315

1416
import numpy as np
@@ -19,7 +21,7 @@
1921
import torch.nn as nn
2022
import torch.nn.functional as F
2123
import torch.optim as optim
22-
import uuid
24+
2325
from ads.model.framework.pytorch_model import PyTorchModel
2426
from ads.model.serde.model_serializer import (
2527
PyTorchOnnxModelSaveSERDE,
@@ -146,6 +148,9 @@ def test_serialize_with_incorrect_model_file_name_onnx(self):
146148
as_onnx=True, model_file_name="model.xxx"
147149
)
148150

151+
@pytest.mark.skip(
152+
reason="ODSC-79463: Fix Missing onnxscript Dependency Causing ONNX Serialization Test Failures"
153+
)
149154
def test_serialize_using_pytorch_without_modelname(self):
150155
"""
151156
Test serialize_model using pytorch without model_file_name
@@ -157,6 +162,9 @@ def test_serialize_using_pytorch_without_modelname(self):
157162
test_pytorch_model.serialize_model(as_onnx=False)
158163
assert os.path.isfile(tmp_model_dir + "model.pt")
159164

165+
@pytest.mark.skip(
166+
reason="ODSC-79463: Fix Missing onnxscript Dependency Causing ONNX Serialization Test Failures"
167+
)
160168
def test_serialize_using_pytorch_with_modelname(self):
161169
"""
162170
Test serialize_model using pytorch with correct model_file_name
@@ -169,6 +177,9 @@ def test_serialize_using_pytorch_with_modelname(self):
169177
test_pytorch_model.serialize_model(as_onnx=False)
170178
assert os.path.isfile(tmp_model_dir + "test1.pt")
171179

180+
@pytest.mark.skip(
181+
reason="ODSC-79463: Fix Missing onnxscript Dependency Causing ONNX Serialization Test Failures"
182+
)
172183
def test_serialize_using_onnx_without_modelname(self):
173184
"""
174185
Test serialize_model using onnx without model_file_name
@@ -183,6 +194,9 @@ def test_serialize_using_onnx_without_modelname(self):
183194
)
184195
assert os.path.exists(os.path.join(tmp_model_dir, "model.onnx"))
185196

197+
@pytest.mark.skip(
198+
reason="ODSC-79463: Fix Missing onnxscript Dependency Causing ONNX Serialization Test Failures"
199+
)
186200
def test_serialize_using_onnx_with_modelname(self):
187201
"""
188202
Test serialize_model using onnx with correct model_file_name
@@ -200,6 +214,9 @@ def test_serialize_using_onnx_with_modelname(self):
200214
os.path.join(tmp_model_dir, test_pytorch_model.model_file_name)
201215
)
202216

217+
@pytest.mark.skip(
218+
reason="ODSC-79463: Fix Missing onnxscript Dependency Causing ONNX Serialization Test Failures"
219+
)
203220
def test_to_onnx(self):
204221
"""
205222
Test if PytorchOnnxModelSerializer.serialize generate onnx model result.
@@ -216,6 +233,9 @@ def test_to_onnx(self):
216233
)
217234
assert os.path.exists(os.path.join(tmp_model_dir, model_file_name))
218235

236+
@pytest.mark.skip(
237+
reason="ODSC-79463: Fix Missing onnxscript Dependency Causing ONNX Serialization Test Failures"
238+
)
219239
def test_to_onnx_reload(self):
220240
"""
221241
Test if PytorchOnnxModelSerializer.serialize generate onnx model result.
@@ -235,6 +255,9 @@ def test_to_onnx_reload(self):
235255
is not None
236256
)
237257

258+
@pytest.mark.skip(
259+
reason="ODSC-79463: Fix Missing onnxscript Dependency Causing ONNX Serialization Test Failures"
260+
)
238261
def test_to_onnx_without_dummy_input(self):
239262
"""
240263
Test if PytorchOnnxModelSerializer.serialize raise expected error
@@ -324,6 +347,9 @@ def test_prepare_default(self):
324347
)
325348
assert os.path.exists(tmp_model_dir + "model.pt")
326349

350+
@pytest.mark.skip(
351+
reason="ODSC-79463: Fix Missing onnxscript Dependency Causing ONNX Serialization Test Failures"
352+
)
327353
def test_prepare_onnx(self):
328354
test_pytorch_model = PyTorchModel(self.myPyTorchModel, tmp_model_dir)
329355
test_pytorch_model.prepare(
@@ -335,6 +361,9 @@ def test_prepare_onnx(self):
335361
)
336362
assert os.path.exists(tmp_model_dir + "model.onnx")
337363

364+
@pytest.mark.skip(
365+
reason="ODSC-79463: Fix Missing onnxscript Dependency Causing ONNX Serialization Test Failures"
366+
)
338367
def test_prepare_onnx_with_X_sample(self):
339368
test_pytorch_model = PyTorchModel(self.myPyTorchModel, tmp_model_dir)
340369
test_pytorch_model.prepare(
@@ -346,6 +375,9 @@ def test_prepare_onnx_with_X_sample(self):
346375
)
347376
assert isinstance(test_pytorch_model.verify([1, 2, 3, 4]), dict)
348377

378+
@pytest.mark.skip(
379+
reason="ODSC-79463: Fix Missing onnxscript Dependency Causing ONNX Serialization Test Failures"
380+
)
349381
def test_prepare_onnx_without_input(self):
350382
test_pytorch_model = PyTorchModel(self.myPyTorchModel, tmp_model_dir)
351383
with pytest.raises(ValueError):
@@ -356,6 +388,9 @@ def test_prepare_onnx_without_input(self):
356388
as_onnx=True,
357389
)
358390

391+
@pytest.mark.skip(
392+
reason="ODSC-79463: Fix Missing onnxscript Dependency Causing ONNX Serialization Test Failures"
393+
)
359394
def test_verify_onnx(self):
360395
"""
361396
Test if PyTorchModel.verify in onnx serialization

0 commit comments

Comments
 (0)