1212
1313
1414class DataScienceModelCollection (DataScienceModel ):
15-
15+
1616 def _auth (self ):
1717 """
1818 Internal method that authenticates the model description instance by initializing OCI clients.
@@ -42,7 +42,7 @@ def _auth(self):
4242
4343 def __init__ (self , spec : ads .Dict = None , ** kwargs ) -> None :
4444 super ().__init__ (spec , ** kwargs )
45-
45+
4646 self .empty_json = {
4747 "version" : "1.0" ,
4848 "type" : "modelOSSReferenceDescription" ,
@@ -72,8 +72,14 @@ def with_ref_model_id(self, model_ocid: str):
7272 logger .error (f"An unexpected error occurred: { e } " )
7373 raise e
7474 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+ ):
7783 """
7884 Adds information about objects in a specified bucket to the model description JSON.
7985
@@ -162,15 +168,17 @@ def list_obj_versions_unpaginated():
162168 raise ValueError (error_message )
163169
164170 tmp_model_file_description = self .model_file_description
165- tmp_model_file_description ['models' ].append ({
171+ tmp_model_file_description ["models" ].append (
172+ {
166173 "namespace" : namespace ,
167174 "bucketName" : bucket ,
168175 "prefix" : prefix ,
169176 "objects" : objects ,
170- })
177+ }
178+ )
171179 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 ):
174182 """
175183 Removes information about objects in a specified bucket from the model description JSON.
176184
@@ -277,4 +285,4 @@ def show(self):
277285 of 4 spaces.
278286 """
279287 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