Skip to content

Commit 8f02859

Browse files
committed
Address review comments
1 parent 31a54e5 commit 8f02859

File tree

3 files changed

+30
-8
lines changed

3 files changed

+30
-8
lines changed

ads/aqua/common/utils.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,10 +244,8 @@ def list_os_files_with_extension(oss_path: str, extension: str) -> [str]:
244244
"""
245245

246246
oss_client = ObjectStorageDetails.from_path(oss_path)
247-
signer = default_signer()
248247

249248
# Ensure the extension is prefixed with a dot if not already
250-
251249
if not extension.startswith("."):
252250
extension = "." + extension
253251
files: List[ObjectSummary] = oss_client.list_objects().objects

ads/aqua/model/entities.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ class AquaFineTuneValidation(DataClassSerializable):
4141
value: str = ""
4242

4343

44+
class ModelValidationResult:
45+
model_file: Optional[str] = None
46+
model_format: ModelFormat = None
47+
telemetry_model_name: str = None
48+
49+
4450
@dataclass(repr=False)
4551
class AquaFineTuningMetric(DataClassSerializable):
4652
name: str = field(default_factory=str)

ads/aqua/model/model.py

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,6 @@
5858
from oci.data_science.models import JobRun, Model
5959

6060

61-
class ModelValidationResult:
62-
model_file: Optional[str] = None
63-
model_format: ModelFormat = None
64-
telemetry_model_name: str = None
65-
66-
6761
class AquaModelApp(AquaApp):
6862
"""Provides a suite of APIs to interact with Aqua models within the Oracle
6963
Cloud Infrastructure Data Science service, serving as an interface for
@@ -728,6 +722,17 @@ def _create_model_catalog_entry(
728722

729723
@staticmethod
730724
def get_model_files(os_path: str, model_format: ModelFormat) -> [str]:
725+
"""
726+
Get a list of model files based on the given OS path and model format.
727+
728+
Args:
729+
os_path (str): The OS path where the model files are located.
730+
model_format (ModelFormat): The format of the model files.
731+
732+
Returns:
733+
List[str]: A list of model file names.
734+
735+
"""
731736
model_files: List[str] = []
732737
if model_format == ModelFormat.SAFETENSORS:
733738
try:
@@ -751,6 +756,19 @@ def validate_model_config(
751756
import_model_details: ImportModelDetails,
752757
verified_model: Optional[DataScienceModel],
753758
) -> ModelValidationResult:
759+
"""
760+
Validates the model configuration and returns the model format telemetry model name.
761+
762+
Args:
763+
import_model_details (ImportModelDetails): The details of the imported model.
764+
verified_model (Optional[DataScienceModel]): The verified model.
765+
766+
Returns:
767+
ModelValidationResult: The result of the model validation.
768+
769+
Raises:
770+
AquaRuntimeError: If there is an error while loading the config file or if the model path is incorrect.
771+
AquaValueError: If the model format is not supported by AQUA."""
754772
inference_containers_config = (
755773
AquaContainerConfig.from_container_index_json().inference
756774
)

0 commit comments

Comments
 (0)