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(
353
353
f"Check if the custom metadata has the artifact path set."
354
354
)
355
355
356
- return ModelConfigResult (config = config or {} , model_details = oci_model )
356
+ return ModelConfigResult (config = config , model_details = oci_model )
357
357
358
358
@property
359
359
def telemetry (self ):
Original file line number Diff line number Diff line change 2
2
# Copyright (c) 2024, 2025 Oracle and/or its affiliates.
3
3
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
4
4
5
- from typing import Any , Dict
5
+ from typing import Any , Dict , Optional
6
6
7
7
from oci .data_science .models import Model
8
8
from pydantic import BaseModel , Field
@@ -31,8 +31,12 @@ class ModelConfigResult(BaseModel):
31
31
config (Dict[str, Any]): A dictionary of the loaded configuration.
32
32
"""
33
33
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
+ )
36
40
37
41
class Config :
38
42
extra = "ignore"
Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env python
2
2
# -*- coding: utf-8 -*--
3
3
4
- # Copyright (c) 2024 Oracle and/or its affiliates.
4
+ # Copyright (c) 2024, 2025 Oracle and/or its affiliates.
5
5
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
6
6
7
7
import copy
16
16
import pytest
17
17
from parameterized import parameterized
18
18
19
+ from ads .aqua .common .entities import ModelConfigResult
19
20
import ads .aqua .modeldeployment .deployment
20
21
import ads .config
21
22
from ads .aqua .modeldeployment import AquaDeploymentApp , MDInferenceResponse
@@ -438,11 +439,11 @@ def test_get_deployment_config(self):
438
439
with open (config_json , "r" ) as _file :
439
440
config = json .load (_file )
440
441
441
- self .app .get_config = MagicMock (return_value = config )
442
+ self .app .get_config = MagicMock (return_value = ModelConfigResult ( config = config ) )
442
443
result = self .app .get_deployment_config (TestDataset .MODEL_ID )
443
444
assert result == config
444
445
445
- self .app .get_config = MagicMock (return_value = None )
446
+ self .app .get_config = MagicMock (return_value = ModelConfigResult ( config = None ) )
446
447
result = self .app .get_deployment_config (TestDataset .MODEL_ID )
447
448
assert result == None
448
449
Original file line number Diff line number Diff line change 17
17
import ads .aqua .finetuning .finetuning
18
18
import ads .config
19
19
from ads .aqua .app import AquaApp
20
+ from ads .aqua .common .entities import ModelConfigResult
20
21
from ads .aqua .common .errors import AquaValueError
21
22
from ads .aqua .finetuning import AquaFineTuningApp
22
23
from ads .aqua .finetuning .constants import FineTuneCustomMetadata
@@ -279,7 +280,7 @@ def test_get_finetuning_config(self):
279
280
with open (config_json , "r" ) as _file :
280
281
config = json .load (_file )
281
282
282
- self .app .get_config = MagicMock (return_value = config )
283
+ self .app .get_config = MagicMock (return_value = ModelConfigResult ( config = config ) )
283
284
result = self .app .get_finetuning_config (model_id = "test-model-id" )
284
285
assert result == config
285
286
You can’t perform that action at this time.
0 commit comments