@@ -28,7 +28,11 @@ class JumpStartDataHolderType:
28
28
__slots__ : List [str ] = []
29
29
30
30
def __eq__ (self , other : Any ) -> bool :
31
- """Returns True if ``other`` is of the same type and has all attributes equal."""
31
+ """Returns True if ``other`` is of the same type and has all attributes equal.
32
+
33
+ Args:
34
+ other (Any): Other object to which to compare this object.
35
+ """
32
36
33
37
if not isinstance (other , type (self )):
34
38
return False
@@ -83,6 +87,12 @@ class JumpStartLaunchedRegionInfo(JumpStartDataHolderType):
83
87
__slots__ = ["content_bucket" , "region_name" ]
84
88
85
89
def __init__ (self , content_bucket : str , region_name : str ):
90
+ """Instantiates JumpStartLaunchedRegionInfo object.
91
+
92
+ Args:
93
+ content_bucket (str): Name of JumpStart s3 content bucket associated with region.
94
+ region_name (str): Name of JumpStart launched region.
95
+ """
86
96
self .content_bucket = content_bucket
87
97
self .region_name = region_name
88
98
@@ -93,7 +103,11 @@ class JumpStartModelHeader(JumpStartDataHolderType):
93
103
__slots__ = ["model_id" , "version" , "min_version" , "spec_key" ]
94
104
95
105
def __init__ (self , header : Dict [str , str ]):
96
- """Initializes a JumpStartModelHeader object from its json representation."""
106
+ """Initializes a JumpStartModelHeader object from its json representation.
107
+
108
+ Args:
109
+ header (Dict[str, str]): Dictionary representation of header.
110
+ """
97
111
self .from_json (header )
98
112
99
113
def to_json (self ) -> Dict [str , str ]:
@@ -102,7 +116,11 @@ def to_json(self) -> Dict[str, str]:
102
116
return json_obj
103
117
104
118
def from_json (self , json_obj : Dict [str , str ]) -> None :
105
- """Sets fields in object based on json of header."""
119
+ """Sets fields in object based on json of header.
120
+
121
+ Args:
122
+ json_obj (Dict[str, str]): Dictionary representation of header.
123
+ """
106
124
self .model_id : str = json_obj ["model_id" ]
107
125
self .version : str = json_obj ["version" ]
108
126
self .min_version : str = json_obj ["min_version" ]
@@ -119,11 +137,19 @@ class JumpStartECRSpecs(JumpStartDataHolderType):
119
137
}
120
138
121
139
def __init__ (self , spec : Dict [str , Any ]):
122
- """Initializes a JumpStartECRSpecs object from its json representation."""
140
+ """Initializes a JumpStartECRSpecs object from its json representation.
141
+
142
+ Args:
143
+ spec (Dict[str, Any]): Dictionary representation of spec.
144
+ """
123
145
self .from_json (spec )
124
146
125
147
def from_json (self , json_obj : Dict [str , Any ]) -> None :
126
- """Sets fields in object based on json."""
148
+ """Sets fields in object based on json.
149
+
150
+ Args:
151
+ json_obj (Dict[str, Any]): Dictionary representation of spec.
152
+ """
127
153
128
154
self .framework = json_obj ["framework" ]
129
155
self .framework_version = json_obj ["framework_version" ]
@@ -154,11 +180,19 @@ class JumpStartModelSpecs(JumpStartDataHolderType):
154
180
]
155
181
156
182
def __init__ (self , spec : Dict [str , Any ]):
157
- """Initializes a JumpStartModelSpecs object from its json representation."""
183
+ """Initializes a JumpStartModelSpecs object from its json representation.
184
+
185
+ Args:
186
+ spec (Dict[str, Any]): Dictionary representation of spec.
187
+ """
158
188
self .from_json (spec )
159
189
160
190
def from_json (self , json_obj : Dict [str , Any ]) -> None :
161
- """Sets fields in object based on json of header."""
191
+ """Sets fields in object based on json of header.
192
+
193
+ Args:
194
+ json_obj (Dict[str, Any]): Dictionary representation of spec.
195
+ """
162
196
self .model_id : str = json_obj ["model_id" ]
163
197
self .version : str = json_obj ["version" ]
164
198
self .min_sdk_version : str = json_obj ["min_sdk_version" ]
@@ -201,6 +235,12 @@ def __init__(
201
235
model_id : str ,
202
236
version : str ,
203
237
) -> None :
238
+ """Instantiates JumpStartVersionedModelId object.
239
+
240
+ Args:
241
+ model_id (str): JumpStart model id.
242
+ version (str): JumpStart model version.
243
+ """
204
244
self .model_id = model_id
205
245
self .version = version
206
246
@@ -215,22 +255,37 @@ def __init__(
215
255
file_type : JumpStartS3FileType ,
216
256
s3_key : str ,
217
257
) -> None :
258
+ """Instantiates JumpStartCachedS3ContentKey object.
259
+
260
+ Args:
261
+ file_type (JumpStartS3FileType): JumpStart file type.
262
+ s3_key (str): object key in s3.
263
+ """
218
264
self .file_type = file_type
219
265
self .s3_key = s3_key
220
266
221
267
222
268
class JumpStartCachedS3ContentValue (JumpStartDataHolderType ):
223
269
"""Data class for the s3 cached content values."""
224
270
225
- __slots__ = ["formatted_file_content " , "md5_hash" ]
271
+ __slots__ = ["formatted_content " , "md5_hash" ]
226
272
227
273
def __init__ (
228
274
self ,
229
- formatted_file_content : Union [
275
+ formatted_content : Union [
230
276
Dict [JumpStartVersionedModelId , JumpStartModelHeader ],
231
277
List [JumpStartModelSpecs ],
232
278
],
233
279
md5_hash : Optional [str ] = None ,
234
280
) -> None :
235
- self .formatted_file_content = formatted_file_content
281
+ """Instantiates JumpStartCachedS3ContentValue object.
282
+
283
+ Args:
284
+ formatted_content (Union[Dict[JumpStartVersionedModelId, JumpStartModelHeader],
285
+ List[JumpStartModelSpecs]]):
286
+ Formatted content for model specs and mappings from
287
+ versioned model ids to specs.
288
+ md5_hash (str): md5_hash for stored file content from s3.
289
+ """
290
+ self .formatted_content = formatted_content
236
291
self .md5_hash = md5_hash
0 commit comments