Skip to content

Commit 2e5cd96

Browse files
authored
Fixes a bug in registering HF models in AQUA UI (#1201)
1 parent 9d51d44 commit 2e5cd96

File tree

3 files changed

+4
-11
lines changed

3 files changed

+4
-11
lines changed

ads/aqua/extension/model_handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ def _find_matching_aqua_model(model_id: str) -> Optional[AquaModelSummary]:
241241
aqua_model_app = AquaModelApp()
242242
model_ocid = aqua_model_app._find_matching_aqua_model(model_id=model_id_lower)
243243
if model_ocid:
244-
return aqua_model_app.get(model_ocid, load_model_card=False)
244+
return aqua_model_app.get(model_ocid)
245245

246246
return None
247247

ads/aqua/model/model.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -491,8 +491,6 @@ def get(self, model_id: str) -> "AquaModel":
491491
----------
492492
model_id: str
493493
The model OCID.
494-
load_model_card: (bool, optional). Defaults to `True`.
495-
Whether to load model card from artifacts or not.
496494
497495
Returns
498496
-------

tests/unitary/with_extras/aqua/test_model_handler.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@
1414

1515
from ads.aqua.common.errors import AquaRuntimeError
1616
from ads.aqua.common.utils import get_hf_model_info
17-
from ads.aqua.constants import (
18-
AQUA_TROUBLESHOOTING_LINK,
19-
STATUS_CODE_MESSAGES,
20-
)
17+
from ads.aqua.constants import AQUA_TROUBLESHOOTING_LINK, STATUS_CODE_MESSAGES
2118
from ads.aqua.extension.errors import ReplyDetails
2219
from ads.aqua.extension.model_handler import (
2320
AquaHuggingFaceHandler,
@@ -27,7 +24,7 @@
2724
)
2825
from ads.aqua.model import AquaModelApp
2926
from ads.aqua.model.entities import AquaModel, AquaModelSummary, HFModelSummary
30-
from ads.config import USER, SERVICE
27+
from ads.config import SERVICE, USER
3128

3229

3330
class ModelHandlerTestCase(TestCase):
@@ -346,9 +343,7 @@ def test_find_matching_aqua_model(
346343
aqua_model_mock_list.assert_called_once()
347344

348345
if expected_aqua_model_name:
349-
mock_get_model.assert_called_with(
350-
expected_aqua_model_id, load_model_card=False
351-
)
346+
mock_get_model.assert_called_with(expected_aqua_model_id)
352347
else:
353348
assert test_result == None
354349

0 commit comments

Comments
 (0)