58
58
from oci .data_science .models import JobRun , Model
59
59
60
60
61
- class ModelValidationResult :
62
- model_file : Optional [str ] = None
63
- model_format : ModelFormat = None
64
- telemetry_model_name : str = None
65
-
66
-
67
61
class AquaModelApp (AquaApp ):
68
62
"""Provides a suite of APIs to interact with Aqua models within the Oracle
69
63
Cloud Infrastructure Data Science service, serving as an interface for
@@ -728,6 +722,17 @@ def _create_model_catalog_entry(
728
722
729
723
@staticmethod
730
724
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
+ """
731
736
model_files : List [str ] = []
732
737
if model_format == ModelFormat .SAFETENSORS :
733
738
try :
@@ -751,6 +756,19 @@ def validate_model_config(
751
756
import_model_details : ImportModelDetails ,
752
757
verified_model : Optional [DataScienceModel ],
753
758
) -> 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."""
754
772
inference_containers_config = (
755
773
AquaContainerConfig .from_container_index_json ().inference
756
774
)
0 commit comments