From 2bc875d31405bf8e13c21c8e996ea313b413c50b Mon Sep 17 00:00:00 2001 From: BW27492 Date: Mon, 10 Jun 2024 16:14:39 +0000 Subject: [PATCH] Fixed ability to retrieve models without cards --- lib/python/src/bailo/__init__.py | 4 ++-- lib/python/src/bailo/helper/entry.py | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/python/src/bailo/__init__.py b/lib/python/src/bailo/__init__.py index 5420aa409..f8723bd56 100644 --- a/lib/python/src/bailo/__init__.py +++ b/lib/python/src/bailo/__init__.py @@ -7,8 +7,8 @@ from __future__ import annotations import logging -# Package Version 2.3.2 -__version__ = "2.3.2" +# Package Version 2.3.3 +__version__ = "2.3.3" from bailo.core.agent import Agent, PkiAgent, TokenAgent diff --git a/lib/python/src/bailo/helper/entry.py b/lib/python/src/bailo/helper/entry.py index 6796ba98e..0bda7bce7 100644 --- a/lib/python/src/bailo/helper/entry.py +++ b/lib/python/src/bailo/helper/entry.py @@ -2,6 +2,7 @@ from typing import Any import logging +import warnings from bailo.core.client import Client from bailo.core.enums import EntryKind, ModelVisibility @@ -69,7 +70,9 @@ def get_card_latest(self) -> None: self.__unpack_card(res["model"]["card"]) logger.info(f"Latest card for ID %s successfully retrieved.", self.id) else: - raise BailoException(f"A model card doesn't exist for model {self.id}") + warnings.warn( + f"ID {self.id} does not have any associated cards. If needed, create a card with the .card_from_schema() method." + ) def get_card_revision(self, version: str) -> None: """Get a specific entry card revision from Bailo.