kaggle 1.8.3__py3-none-any.whl → 1.8.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,145 +0,0 @@
1
- #!/usr/bin/python
2
- #
3
- # Copyright 2024 Kaggle Inc
4
- #
5
- # Licensed under the Apache License, Version 2.0 (the "License");
6
- # you may not use this file except in compliance with the License.
7
- # You may obtain a copy of the License at
8
- #
9
- # http://www.apache.org/licenses/LICENSE-2.0
10
- #
11
- # Unless required by applicable law or agreed to in writing, software
12
- # distributed under the License is distributed on an "AS IS" BASIS,
13
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- # See the License for the specific language governing permissions and
15
- # limitations under the License.
16
-
17
- # coding: utf-8
18
-
19
- import pprint
20
- import re # noqa: F401
21
-
22
- import six
23
-
24
- from kaggle.models.upload_file import UploadFile # noqa: F401,E501
25
-
26
-
27
- class ModelInstanceNewVersionRequest(object):
28
- """
29
- Attributes:
30
- project_types (dict): The key is attribute name
31
- and the value is attribute type.
32
- attribute_map (dict): The key is attribute name
33
- and the value is json key in definition.
34
- """
35
-
36
- project_types = {"version_notes": "str", "files": "list[UploadFile]"}
37
-
38
- attribute_map = {"version_notes": "versionNotes", "files": "files"}
39
-
40
- def __init__(self, version_notes=None, files=None): # noqa: E501
41
-
42
- self._version_notes = None
43
- self._files = None
44
- self.discriminator = None
45
-
46
- if version_notes is not None:
47
- self.version_notes = version_notes
48
- self.files = files
49
-
50
- @property
51
- def version_notes(self):
52
- """Gets the version_notes of this ModelInstanceNewVersionRequest. #
53
- noqa: E501.
54
-
55
- The version notes for the model instance version # noqa: E501
56
-
57
- :return: The version_notes of this
58
- ModelInstanceNewVersionRequest. # noqa: E501
59
- :rtype: str
60
- """
61
- return self._version_notes
62
-
63
- @version_notes.setter
64
- def version_notes(self, version_notes):
65
- """Sets the version_notes of this ModelInstanceNewVersionRequest.
66
-
67
- The version notes for the model instance version # noqa: E501
68
-
69
- :param version_notes: The version_notes of this
70
- ModelInstanceNewVersionRequest. # noqa: E501
71
- :type: str
72
- """
73
-
74
- self._version_notes = version_notes
75
-
76
- @property
77
- def files(self):
78
- """Gets the files of this ModelInstanceNewVersionRequest. # noqa:
79
- E501.
80
-
81
- A list of files that should be associated with the model
82
- instance version # noqa: E501
83
-
84
- :return: The files of this ModelInstanceNewVersionRequest. #
85
- noqa: E501
86
- :rtype: list[UploadFile]
87
- """
88
- return self._files
89
-
90
- @files.setter
91
- def files(self, files):
92
- """Sets the files of this ModelInstanceNewVersionRequest.
93
-
94
- A list of files that should be associated with the model
95
- instance version # noqa: E501
96
-
97
- :param files: The files of this ModelInstanceNewVersionRequest.
98
- # noqa: E501
99
- :type: list[UploadFile]
100
- """
101
- if files is None:
102
- raise ValueError("Invalid value for `files`, must not be `None`") # noqa: E501
103
-
104
- self._files = files
105
-
106
- def to_dict(self):
107
- """Returns the model properties as a dict."""
108
- result = {}
109
-
110
- for attr, _ in six.iteritems(self.project_types):
111
- value = getattr(self, attr)
112
- if isinstance(value, list):
113
- result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value))
114
- elif hasattr(value, "to_dict"):
115
- result[attr] = value.to_dict()
116
- elif isinstance(value, dict):
117
- result[attr] = dict(
118
- map(
119
- lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item,
120
- value.items(),
121
- )
122
- )
123
- else:
124
- result[attr] = value
125
-
126
- return result
127
-
128
- def to_str(self):
129
- """Returns the string representation of the model."""
130
- return pprint.pformat(self.to_dict())
131
-
132
- def __repr__(self):
133
- """For `print` and `pprint`"""
134
- return self.to_str()
135
-
136
- def __eq__(self, other):
137
- """Returns true if both objects are equal."""
138
- if not isinstance(other, ModelInstanceNewVersionRequest):
139
- return False
140
-
141
- return self.__dict__ == other.__dict__
142
-
143
- def __ne__(self, other):
144
- """Returns true if both objects are not equal."""
145
- return not self == other
@@ -1,451 +0,0 @@
1
- #!/usr/bin/python
2
- #
3
- # Copyright 2024 Kaggle Inc
4
- #
5
- # Licensed under the Apache License, Version 2.0 (the "License");
6
- # you may not use this file except in compliance with the License.
7
- # You may obtain a copy of the License at
8
- #
9
- # http://www.apache.org/licenses/LICENSE-2.0
10
- #
11
- # Unless required by applicable law or agreed to in writing, software
12
- # distributed under the License is distributed on an "AS IS" BASIS,
13
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- # See the License for the specific language governing permissions and
15
- # limitations under the License.
16
-
17
- # coding: utf-8
18
-
19
- import pprint
20
- import re # noqa: F401
21
-
22
- import six
23
-
24
-
25
- class ModelInstanceUpdateRequest(object):
26
- """
27
- Attributes:
28
- project_types (dict): The key is attribute name
29
- and the value is attribute type.
30
- attribute_map (dict): The key is attribute name
31
- and the value is json key in definition.
32
- """
33
-
34
- project_types = {
35
- "overview": "str",
36
- "usage": "str",
37
- "license_name": "str",
38
- "fine_tunable": "bool",
39
- "training_data": "list[str]",
40
- "model_instance_type": "str",
41
- "base_model_instance": "str",
42
- "external_base_model_url": "int",
43
- "update_mask": "str",
44
- }
45
-
46
- attribute_map = {
47
- "overview": "overview",
48
- "usage": "usage",
49
- "license_name": "licenseName",
50
- "fine_tunable": "fineTunable",
51
- "training_data": "trainingData",
52
- "model_instance_type": "modelInstanceType",
53
- "base_model_instance": "baseModelInstance",
54
- "external_base_model_url": "externalBaseModelUrl",
55
- "update_mask": "updateMask",
56
- }
57
-
58
- def __init__(
59
- self,
60
- overview=None,
61
- usage=None,
62
- license_name="Apache 2.0",
63
- fine_tunable=True,
64
- training_data=None,
65
- model_instance_type=None,
66
- base_model_instance=None,
67
- external_base_model_url=None,
68
- update_mask=None,
69
- ): # noqa: E501
70
-
71
- self._overview = None
72
- self._usage = None
73
- self._license_name = None
74
- self._fine_tunable = None
75
- self._training_data = None
76
- self._model_instance_type = None
77
- self._base_model_instance = None
78
- self._external_base_model_url = None
79
- self._update_mask = None
80
- self.discriminator = None
81
-
82
- if overview is not None:
83
- self.overview = overview
84
- if usage is not None:
85
- self.usage = usage
86
- if license_name is not None:
87
- self.license_name = license_name
88
- if fine_tunable is not None:
89
- self.fine_tunable = fine_tunable
90
- if training_data is not None:
91
- self.training_data = training_data
92
- if model_instance_type is not None:
93
- self.model_instance_type = model_instance_type
94
- if base_model_instance is not None:
95
- self.base_model_instance = base_model_instance
96
- if external_base_model_url is not None:
97
- self.external_base_model_url = external_base_model_url
98
- self.update_mask = update_mask
99
-
100
- @property
101
- def overview(self):
102
- """Gets the overview of this ModelInstanceUpdateRequest. # noqa: E501.
103
-
104
- The overview of the model instance (markdown) # noqa: E501
105
-
106
- :return: The overview of this ModelInstanceUpdateRequest. #
107
- noqa: E501
108
- :rtype: str
109
- """
110
- return self._overview
111
-
112
- @overview.setter
113
- def overview(self, overview):
114
- """Sets the overview of this ModelInstanceUpdateRequest.
115
-
116
- The overview of the model instance (markdown) # noqa: E501
117
-
118
- :param overview: The overview of this
119
- ModelInstanceUpdateRequest. # noqa: E501
120
- :type: str
121
- """
122
-
123
- self._overview = overview
124
-
125
- @property
126
- def usage(self):
127
- """Gets the usage of this ModelInstanceUpdateRequest. # noqa: E501.
128
-
129
- The description of how to use the model instance (markdown) #
130
- noqa: E501
131
-
132
- :return: The usage of this ModelInstanceUpdateRequest. # noqa:
133
- E501
134
- :rtype: str
135
- """
136
- return self._usage
137
-
138
- @usage.setter
139
- def usage(self, usage):
140
- """Sets the usage of this ModelInstanceUpdateRequest.
141
-
142
- The description of how to use the model instance (markdown) #
143
- noqa: E501
144
-
145
- :param usage: The usage of this ModelInstanceUpdateRequest. #
146
- noqa: E501
147
- :type: str
148
- """
149
-
150
- self._usage = usage
151
-
152
- @property
153
- def license_name(self):
154
- """Gets the license_name of this ModelInstanceUpdateRequest. # noqa:
155
- E501.
156
-
157
- The license that should be associated with the model instance #
158
- noqa: E501
159
-
160
- :return: The license_name of this ModelInstanceUpdateRequest. #
161
- noqa: E501
162
- :rtype: str
163
- """
164
- return self._license_name
165
-
166
- @license_name.setter
167
- def license_name(self, license_name):
168
- """Sets the license_name of this ModelInstanceUpdateRequest.
169
-
170
- The license that should be associated with the model instance #
171
- noqa: E501
172
-
173
- :param license_name: The license_name of this
174
- ModelInstanceUpdateRequest. # noqa: E501
175
- :type: str
176
- """
177
- allowed_values = [
178
- "CC0 1.0",
179
- "CC BY-NC-SA 4.0",
180
- "Unknown",
181
- "CC BY-SA 4.0",
182
- "GPL 2",
183
- "CC BY-SA 3.0",
184
- "Other",
185
- "Other (specified in description)",
186
- "CC BY 4.0",
187
- "Attribution 4.0 International (CC BY 4.0)",
188
- "CC BY-NC 4.0",
189
- "Attribution-NonCommercial 4.0 International (CC BY-NC 4.0)",
190
- "PDDL",
191
- "ODC Public Domain Dedication and Licence (PDDL)",
192
- "CC BY 3.0",
193
- "Attribution 3.0 Unported (CC BY 3.0)",
194
- "CC BY 3.0 IGO",
195
- "Attribution 3.0 IGO (CC BY 3.0 IGO)",
196
- "CC BY-NC-SA 3.0 IGO",
197
- "Attribution-NonCommercial-ShareAlike 3.0 IGO (CC BY-NC-SA 3.0 IGO)",
198
- "CDLA Permissive 1.0",
199
- "Community Data License Agreement - Permissive - Version 1.0",
200
- "CDLA Sharing 1.0",
201
- "Community Data License Agreement - Sharing - Version 1.0",
202
- "CC BY-ND 4.0",
203
- "Attribution-NoDerivatives 4.0 International (CC BY-ND 4.0)",
204
- "CC BY-NC-ND 4.0",
205
- "Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0)",
206
- "ODC-BY 1.0",
207
- "ODC Attribution License (ODC-By)",
208
- "LGPL 3.0",
209
- "GNU Lesser General Public License 3.0",
210
- "AGPL 3.0",
211
- "GNU Affero General Public License 3.0",
212
- "FDL 1.3",
213
- "GNU Free Documentation License 1.3",
214
- "apache-2.0",
215
- "Apache 2.0",
216
- "mit",
217
- "MIT",
218
- "bsd-3-clause",
219
- "BSD-3-Clause",
220
- "Llama 2",
221
- "Llama 2 Community License",
222
- "Gemma",
223
- "gpl-3",
224
- "GPL 3",
225
- "RAIL-M",
226
- "AI Pubs Open RAIL-M License",
227
- "AIPubs Research-Use RAIL-M",
228
- "AI Pubs Research-Use RAIL-M License",
229
- "BigScience OpenRAIL-M",
230
- "BigScience Open RAIL-M License",
231
- "RAIL",
232
- "RAIL (specified in description)",
233
- "Llama 3",
234
- "Llama 3 Community License",
235
- ] # noqa: E501
236
- if license_name not in allowed_values:
237
- raise ValueError(
238
- "Invalid value for `license_name` ({0}), must be one of {1}".format( # noqa: E501
239
- license_name, allowed_values
240
- )
241
- )
242
-
243
- self._license_name = license_name
244
-
245
- @property
246
- def fine_tunable(self):
247
- """Gets the fine_tunable of this ModelInstanceUpdateRequest. # noqa:
248
- E501.
249
-
250
- Whether the model instance is fine tunable # noqa: E501
251
-
252
- :return: The fine_tunable of this ModelInstanceUpdateRequest. #
253
- noqa: E501
254
- :rtype: bool
255
- """
256
- return self._fine_tunable
257
-
258
- @fine_tunable.setter
259
- def fine_tunable(self, fine_tunable):
260
- """Sets the fine_tunable of this ModelInstanceUpdateRequest.
261
-
262
- Whether the model instance is fine tunable # noqa: E501
263
-
264
- :param fine_tunable: The fine_tunable of this
265
- ModelInstanceUpdateRequest. # noqa: E501
266
- :type: bool
267
- """
268
-
269
- self._fine_tunable = fine_tunable
270
-
271
- @property
272
- def training_data(self):
273
- """Gets the training_data of this ModelInstanceUpdateRequest. # noqa:
274
- E501.
275
-
276
- A list of training data (urls or names) # noqa: E501
277
-
278
- :return: The training_data of this ModelInstanceUpdateRequest. #
279
- noqa: E501
280
- :rtype: list[str]
281
- """
282
- return self._training_data
283
-
284
- @training_data.setter
285
- def training_data(self, training_data):
286
- """Sets the training_data of this ModelInstanceUpdateRequest.
287
-
288
- A list of training data (urls or names) # noqa: E501
289
-
290
- :param training_data: The training_data of this
291
- ModelInstanceUpdateRequest. # noqa: E501
292
- :type: list[str]
293
- """
294
-
295
- self._training_data = training_data
296
-
297
- @property
298
- def model_instance_type(self):
299
- """Gets the model_instance_type of this ModelInstanceUpdateRequest. #
300
- noqa: E501.
301
-
302
- Whether the model instance is a base model, external variant,
303
- internal variant, or unspecified # noqa: E501
304
-
305
- :return: The model_instance_type of this
306
- ModelInstanceUpdateRequest. # noqa: E501
307
- :rtype: str
308
- """
309
- return self._model_instance_type
310
-
311
- @model_instance_type.setter
312
- def model_instance_type(self, model_instance_type):
313
- """Sets the model_instance_type of this ModelInstanceUpdateRequest.
314
-
315
- Whether the model instance is a base model, external variant,
316
- internal variant, or unspecified # noqa: E501
317
-
318
- :param model_instance_type: The model_instance_type of this
319
- ModelInstanceUpdateRequest. # noqa: E501
320
- :type: str
321
- """
322
- allowed_values = ["Unspecified", "BaseModel", "KaggleVariant", "ExternalVariant"] # noqa: E501
323
- if model_instance_type not in allowed_values:
324
- raise ValueError(
325
- "Invalid value for `model_instance_type` ({0}), must be one of {1}".format( # noqa: E501
326
- model_instance_type, allowed_values
327
- )
328
- )
329
-
330
- self._model_instance_type = model_instance_type
331
-
332
- @property
333
- def base_model_instance(self):
334
- """Gets the base_model_instance of this ModelInstanceUpdateRequest. #
335
- noqa: E501.
336
-
337
- If this is an internal variant, the `{owner-slug}/{model-slug}/{framework}/{instance-slug}` of the base model instance # noqa: E501
338
-
339
- :return: The base_model_instance of this ModelInstanceUpdateRequest. # noqa: E501
340
- :rtype: str
341
- """
342
- return self._base_model_instance
343
-
344
- @base_model_instance.setter
345
- def base_model_instance(self, base_model_instance):
346
- """Sets the base_model_instance of this ModelInstanceUpdateRequest.
347
-
348
- If this is an internal variant, the `{owner-slug}/{model-slug}/{framework}/{instance-slug}` of the base model instance # noqa: E501
349
-
350
- :param base_model_instance: The base_model_instance of this ModelInstanceUpdateRequest. # noqa: E501
351
- :type: str
352
- """
353
-
354
- self._base_model_instance = base_model_instance
355
-
356
- @property
357
- def external_base_model_url(self):
358
- """Gets the external_base_model_url of this ModelInstanceUpdateRequest.
359
- # noqa: E501.
360
-
361
- If this is an external variant, a URL to the base model # noqa:
362
- E501
363
-
364
- :return: The external_base_model_url of this
365
- ModelInstanceUpdateRequest. # noqa: E501
366
- :rtype: int
367
- """
368
- return self._external_base_model_url
369
-
370
- @external_base_model_url.setter
371
- def external_base_model_url(self, external_base_model_url):
372
- """Sets the external_base_model_url of this ModelInstanceUpdateRequest.
373
-
374
- If this is an external variant, a URL to the base model # noqa:
375
- E501
376
-
377
- :param external_base_model_url: The external_base_model_url of
378
- this ModelInstanceUpdateRequest. # noqa: E501
379
- :type: int
380
- """
381
-
382
- self._external_base_model_url = external_base_model_url
383
-
384
- @property
385
- def update_mask(self):
386
- """Gets the update_mask of this ModelInstanceUpdateRequest. # noqa:
387
- E501.
388
-
389
- Describes which fields to update # noqa: E501
390
-
391
- :return: The update_mask of this ModelInstanceUpdateRequest. #
392
- noqa: E501
393
- :rtype: str
394
- """
395
- return self._update_mask
396
-
397
- @update_mask.setter
398
- def update_mask(self, update_mask):
399
- """Sets the update_mask of this ModelInstanceUpdateRequest.
400
-
401
- Describes which fields to update # noqa: E501
402
-
403
- :param update_mask: The update_mask of this
404
- ModelInstanceUpdateRequest. # noqa: E501
405
- :type: str
406
- """
407
- if update_mask is None:
408
- raise ValueError("Invalid value for `update_mask`, must not be `None`") # noqa: E501
409
-
410
- self._update_mask = update_mask
411
-
412
- def to_dict(self):
413
- """Returns the model properties as a dict."""
414
- result = {}
415
-
416
- for attr, _ in six.iteritems(self.project_types):
417
- value = getattr(self, attr)
418
- if isinstance(value, list):
419
- result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value))
420
- elif hasattr(value, "to_dict"):
421
- result[attr] = value.to_dict()
422
- elif isinstance(value, dict):
423
- result[attr] = dict(
424
- map(
425
- lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item,
426
- value.items(),
427
- )
428
- )
429
- else:
430
- result[attr] = value
431
-
432
- return result
433
-
434
- def to_str(self):
435
- """Returns the string representation of the model."""
436
- return pprint.pformat(self.to_dict())
437
-
438
- def __repr__(self):
439
- """For `print` and `pprint`"""
440
- return self.to_str()
441
-
442
- def __eq__(self, other):
443
- """Returns true if both objects are equal."""
444
- if not isinstance(other, ModelInstanceUpdateRequest):
445
- return False
446
-
447
- return self.__dict__ == other.__dict__
448
-
449
- def __ne__(self, other):
450
- """Returns true if both objects are not equal."""
451
- return not self == other