File tree Expand file tree Collapse file tree 4 files changed +14
-8
lines changed Expand file tree Collapse file tree 4 files changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -353,7 +353,7 @@ def get_config(
353353 f"Check if the custom metadata has the artifact path set."
354354 )
355355
356- return ModelConfigResult (config = config or {} , model_details = oci_model )
356+ return ModelConfigResult (config = config , model_details = oci_model )
357357
358358 @property
359359 def telemetry (self ):
Original file line number Diff line number Diff line change 22# Copyright (c) 2024, 2025 Oracle and/or its affiliates.
33# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
44
5- from typing import Any , Dict
5+ from typing import Any , Dict , Optional
66
77from oci .data_science .models import Model
88from pydantic import BaseModel , Field
@@ -31,8 +31,12 @@ class ModelConfigResult(BaseModel):
3131 config (Dict[str, Any]): A dictionary of the loaded configuration.
3232 """
3333
34- config : Dict [str , Any ] = Field (..., description = "Loaded configuration dictionary." )
35- model_details : Model = Field (..., description = "Details of the model from OCI." )
34+ config : Optional [Dict [str , Any ]] = Field (
35+ None , description = "Loaded configuration dictionary."
36+ )
37+ model_details : Optional [Model ] = Field (
38+ None , description = "Details of the model from OCI."
39+ )
3640
3741 class Config :
3842 extra = "ignore"
Original file line number Diff line number Diff line change 11#!/usr/bin/env python
22# -*- coding: utf-8 -*--
33
4- # Copyright (c) 2024 Oracle and/or its affiliates.
4+ # Copyright (c) 2024, 2025 Oracle and/or its affiliates.
55# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
66
77import copy
1616import pytest
1717from parameterized import parameterized
1818
19+ from ads .aqua .common .entities import ModelConfigResult
1920import ads .aqua .modeldeployment .deployment
2021import ads .config
2122from ads .aqua .modeldeployment import AquaDeploymentApp , MDInferenceResponse
@@ -438,11 +439,11 @@ def test_get_deployment_config(self):
438439 with open (config_json , "r" ) as _file :
439440 config = json .load (_file )
440441
441- self .app .get_config = MagicMock (return_value = config )
442+ self .app .get_config = MagicMock (return_value = ModelConfigResult ( config = config ) )
442443 result = self .app .get_deployment_config (TestDataset .MODEL_ID )
443444 assert result == config
444445
445- self .app .get_config = MagicMock (return_value = None )
446+ self .app .get_config = MagicMock (return_value = ModelConfigResult ( config = None ) )
446447 result = self .app .get_deployment_config (TestDataset .MODEL_ID )
447448 assert result == None
448449
Original file line number Diff line number Diff line change 1717import ads .aqua .finetuning .finetuning
1818import ads .config
1919from ads .aqua .app import AquaApp
20+ from ads .aqua .common .entities import ModelConfigResult
2021from ads .aqua .common .errors import AquaValueError
2122from ads .aqua .finetuning import AquaFineTuningApp
2223from ads .aqua .finetuning .constants import FineTuneCustomMetadata
@@ -279,7 +280,7 @@ def test_get_finetuning_config(self):
279280 with open (config_json , "r" ) as _file :
280281 config = json .load (_file )
281282
282- self .app .get_config = MagicMock (return_value = config )
283+ self .app .get_config = MagicMock (return_value = ModelConfigResult ( config = config ) )
283284 result = self .app .get_finetuning_config (model_id = "test-model-id" )
284285 assert result == config
285286
You can’t perform that action at this time.
0 commit comments