12
12
13
13
14
14
class DataScienceModelCollection (DataScienceModel ):
15
-
15
+
16
16
def _auth (self ):
17
17
"""
18
18
Internal method that authenticates the model description instance by initializing OCI clients.
@@ -42,7 +42,7 @@ def _auth(self):
42
42
43
43
def __init__ (self , spec : ads .Dict = None , ** kwargs ) -> None :
44
44
super ().__init__ (spec , ** kwargs )
45
-
45
+
46
46
self .empty_json = {
47
47
"version" : "1.0" ,
48
48
"type" : "modelOSSReferenceDescription" ,
@@ -72,8 +72,14 @@ def with_ref_model_id(self, model_ocid: str):
72
72
logger .error (f"An unexpected error occurred: { e } " )
73
73
raise e
74
74
return self
75
-
76
- def add (self , namespace : str , bucket : str , prefix : Optional [str ] = None , files : Optional [List [str ]] = None ):
75
+
76
+ def add (
77
+ self ,
78
+ namespace : str ,
79
+ bucket : str ,
80
+ prefix : Optional [str ] = None ,
81
+ files : Optional [List [str ]] = None ,
82
+ ):
77
83
"""
78
84
Adds information about objects in a specified bucket to the model description JSON.
79
85
@@ -162,15 +168,17 @@ def list_obj_versions_unpaginated():
162
168
raise ValueError (error_message )
163
169
164
170
tmp_model_file_description = self .model_file_description
165
- tmp_model_file_description ['models' ].append ({
171
+ tmp_model_file_description ["models" ].append (
172
+ {
166
173
"namespace" : namespace ,
167
174
"bucketName" : bucket ,
168
175
"prefix" : prefix ,
169
176
"objects" : objects ,
170
- })
177
+ }
178
+ )
171
179
self .set_spec (self .CONST_MODEL_FILE_DESCRIPTION , tmp_model_file_description )
172
-
173
- def remove (self , namespace : str , bucket : str , prefix : Optional [str ]= None ):
180
+
181
+ def remove (self , namespace : str , bucket : str , prefix : Optional [str ] = None ):
174
182
"""
175
183
Removes information about objects in a specified bucket from the model description JSON.
176
184
@@ -277,4 +285,4 @@ def show(self):
277
285
of 4 spaces.
278
286
"""
279
287
logger .info (json .dumps (self .model_file_description , indent = 4 ))
280
- return json .dumps (self .model_file_description , indent = 4 )
288
+ return json .dumps (self .model_file_description , indent = 4 )
0 commit comments