kaggle 1.7.4.2__py3-none-any.whl → 1.8.0__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.
- kaggle/__init__.py +10 -6
- kaggle/api/kaggle_api.py +574 -585
- kaggle/api/kaggle_api_extended.py +5251 -4738
- kaggle/cli.py +1335 -1585
- kaggle/models/api_blob_type.py +3 -3
- kaggle/models/dataset_column.py +129 -129
- kaggle/models/dataset_new_request.py +130 -72
- kaggle/models/dataset_new_version_request.py +88 -56
- kaggle/models/dataset_update_settings_request.py +93 -59
- kaggle/models/kaggle_models_extended.py +169 -172
- kaggle/models/kernel_push_request.py +152 -100
- kaggle/models/model_instance_new_version_request.py +30 -30
- kaggle/models/model_instance_update_request.py +171 -71
- kaggle/models/model_new_instance_request.py +223 -88
- kaggle/models/model_new_request.py +61 -46
- kaggle/models/model_update_request.py +66 -48
- kaggle/models/start_blob_upload_request.py +146 -138
- kaggle/models/start_blob_upload_response.py +83 -78
- kaggle/models/upload_file.py +92 -96
- kaggle/test/test_authenticate.py +23 -23
- {kaggle-1.7.4.2.dist-info → kaggle-1.8.0.dist-info}/METADATA +11 -15
- kaggle-1.8.0.dist-info/RECORD +148 -0
- kagglesdk/__init__.py +5 -1
- kagglesdk/benchmarks/services/__init__.py +0 -0
- kagglesdk/benchmarks/services/benchmarks_api_service.py +19 -0
- kagglesdk/benchmarks/types/__init__.py +0 -0
- kagglesdk/benchmarks/types/benchmark_types.py +307 -0
- kagglesdk/benchmarks/types/benchmarks_api_service.py +243 -0
- kagglesdk/blobs/services/blob_api_service.py +1 -1
- kagglesdk/blobs/types/blob_api_service.py +2 -2
- kagglesdk/common/services/__init__.py +0 -0
- kagglesdk/common/services/operations_service.py +46 -0
- kagglesdk/common/types/file_download.py +1 -1
- kagglesdk/common/types/http_redirect.py +1 -1
- kagglesdk/common/types/operations.py +194 -0
- kagglesdk/common/types/operations_service.py +48 -0
- kagglesdk/community/__init__.py +0 -0
- kagglesdk/community/types/__init__.py +0 -0
- kagglesdk/community/types/content_enums.py +44 -0
- kagglesdk/community/types/organization.py +410 -0
- kagglesdk/competitions/services/competition_api_service.py +49 -12
- kagglesdk/competitions/types/competition.py +14 -0
- kagglesdk/competitions/types/competition_api_service.py +1639 -1275
- kagglesdk/competitions/types/search_competitions.py +28 -0
- kagglesdk/datasets/databundles/__init__.py +0 -0
- kagglesdk/datasets/databundles/types/__init__.py +0 -0
- kagglesdk/datasets/databundles/types/databundle_api_types.py +540 -0
- kagglesdk/datasets/services/dataset_api_service.py +39 -14
- kagglesdk/datasets/types/dataset_api_service.py +567 -297
- kagglesdk/datasets/types/dataset_enums.py +21 -0
- kagglesdk/datasets/types/dataset_service.py +145 -0
- kagglesdk/datasets/types/dataset_types.py +74 -74
- kagglesdk/datasets/types/search_datasets.py +6 -0
- kagglesdk/discussions/__init__.py +0 -0
- kagglesdk/discussions/types/__init__.py +0 -0
- kagglesdk/discussions/types/search_discussions.py +43 -0
- kagglesdk/discussions/types/writeup_enums.py +11 -0
- kagglesdk/education/services/education_api_service.py +1 -1
- kagglesdk/education/types/education_api_service.py +1 -1
- kagglesdk/kaggle_client.py +55 -20
- kagglesdk/kaggle_creds.py +148 -0
- kagglesdk/kaggle_env.py +89 -27
- kagglesdk/kaggle_http_client.py +235 -290
- kagglesdk/kaggle_oauth.py +200 -0
- kagglesdk/kaggle_object.py +298 -250
- kagglesdk/kernels/services/kernels_api_service.py +46 -9
- kagglesdk/kernels/types/kernels_api_service.py +658 -158
- kagglesdk/kernels/types/kernels_enums.py +6 -0
- kagglesdk/kernels/types/search_kernels.py +6 -0
- kagglesdk/licenses/__init__.py +0 -0
- kagglesdk/licenses/types/__init__.py +0 -0
- kagglesdk/licenses/types/licenses_types.py +182 -0
- kagglesdk/models/services/model_api_service.py +46 -21
- kagglesdk/models/types/model_api_service.py +1018 -652
- kagglesdk/models/types/model_enums.py +8 -0
- kagglesdk/models/types/model_service.py +71 -71
- kagglesdk/models/types/model_types.py +1057 -5
- kagglesdk/models/types/search_models.py +8 -0
- kagglesdk/search/__init__.py +0 -0
- kagglesdk/search/services/__init__.py +0 -0
- kagglesdk/search/services/search_api_service.py +19 -0
- kagglesdk/search/types/__init__.py +0 -0
- kagglesdk/search/types/search_api_service.py +2435 -0
- kagglesdk/search/types/search_content_shared.py +50 -0
- kagglesdk/search/types/search_enums.py +45 -0
- kagglesdk/search/types/search_service.py +303 -0
- kagglesdk/security/__init__.py +0 -0
- kagglesdk/security/services/__init__.py +0 -0
- kagglesdk/security/services/iam_service.py +31 -0
- kagglesdk/security/services/oauth_service.py +58 -0
- kagglesdk/security/types/__init__.py +0 -0
- kagglesdk/security/types/authentication.py +171 -0
- kagglesdk/security/types/iam_service.py +496 -0
- kagglesdk/security/types/oauth_service.py +1181 -0
- kagglesdk/security/types/roles.py +8 -0
- kagglesdk/security/types/security_types.py +159 -0
- kagglesdk/test/__init__.py +0 -0
- kagglesdk/test/test_client.py +20 -24
- kagglesdk/users/services/__init__.py +0 -0
- kagglesdk/users/services/account_service.py +31 -0
- kagglesdk/users/services/group_api_service.py +31 -0
- kagglesdk/users/types/account_service.py +345 -0
- kagglesdk/users/types/group_api_service.py +315 -0
- kagglesdk/users/types/group_types.py +165 -0
- kagglesdk/users/types/groups_enum.py +8 -0
- kagglesdk/users/types/progression_service.py +9 -0
- kagglesdk/users/types/search_users.py +23 -0
- kagglesdk/users/types/user_avatar.py +226 -0
- kaggle/configuration.py +0 -206
- kaggle-1.7.4.2.dist-info/RECORD +0 -89
- {kaggle-1.7.4.2.dist-info → kaggle-1.8.0.dist-info}/WHEEL +0 -0
- {kaggle-1.7.4.2.dist-info → kaggle-1.8.0.dist-info}/entry_points.txt +0 -0
- {kaggle-1.7.4.2.dist-info → kaggle-1.8.0.dist-info}/licenses/LICENSE.txt +0 -0
- {kaggle/test → kagglesdk/benchmarks}/__init__.py +0 -0
|
@@ -32,35 +32,49 @@ class ModelNewInstanceRequest(object):
|
|
|
32
32
|
attribute_map (dict): The key is attribute name
|
|
33
33
|
and the value is json key in definition.
|
|
34
34
|
"""
|
|
35
|
+
|
|
35
36
|
project_types = {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
37
|
+
"instance_slug": "str",
|
|
38
|
+
"framework": "str",
|
|
39
|
+
"overview": "str",
|
|
40
|
+
"usage": "str",
|
|
41
|
+
"license_name": "str",
|
|
42
|
+
"fine_tunable": "bool",
|
|
43
|
+
"training_data": "list[str]",
|
|
44
|
+
"model_instance_type": "str",
|
|
45
|
+
"base_model_instance": "str",
|
|
46
|
+
"external_base_model_url": "int",
|
|
47
|
+
"files": "list[UploadFile]",
|
|
47
48
|
}
|
|
48
49
|
|
|
49
50
|
attribute_map = {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
51
|
+
"instance_slug": "instanceSlug",
|
|
52
|
+
"framework": "framework",
|
|
53
|
+
"overview": "overview",
|
|
54
|
+
"usage": "usage",
|
|
55
|
+
"license_name": "licenseName",
|
|
56
|
+
"fine_tunable": "fineTunable",
|
|
57
|
+
"training_data": "trainingData",
|
|
58
|
+
"model_instance_type": "modelInstanceType",
|
|
59
|
+
"base_model_instance": "baseModelInstance",
|
|
60
|
+
"external_base_model_url": "externalBaseModelUrl",
|
|
61
|
+
"files": "files",
|
|
61
62
|
}
|
|
62
63
|
|
|
63
|
-
def __init__(
|
|
64
|
+
def __init__(
|
|
65
|
+
self,
|
|
66
|
+
instance_slug=None,
|
|
67
|
+
framework=None,
|
|
68
|
+
overview=None,
|
|
69
|
+
usage=None,
|
|
70
|
+
license_name="Apache 2.0",
|
|
71
|
+
fine_tunable=True,
|
|
72
|
+
training_data=None,
|
|
73
|
+
model_instance_type=None,
|
|
74
|
+
base_model_instance=None,
|
|
75
|
+
external_base_model_url=None,
|
|
76
|
+
files=None,
|
|
77
|
+
): # noqa: E501
|
|
64
78
|
|
|
65
79
|
self._instance_slug = None
|
|
66
80
|
self._framework = None
|
|
@@ -97,11 +111,14 @@ class ModelNewInstanceRequest(object):
|
|
|
97
111
|
|
|
98
112
|
@property
|
|
99
113
|
def instance_slug(self):
|
|
100
|
-
"""Gets the instance_slug of this ModelNewInstanceRequest. # noqa:
|
|
114
|
+
"""Gets the instance_slug of this ModelNewInstanceRequest. # noqa:
|
|
115
|
+
E501.
|
|
101
116
|
|
|
102
|
-
The slug that the model instance should be created with # noqa:
|
|
117
|
+
The slug that the model instance should be created with # noqa:
|
|
118
|
+
E501
|
|
103
119
|
|
|
104
|
-
:return: The instance_slug of this ModelNewInstanceRequest.
|
|
120
|
+
:return: The instance_slug of this ModelNewInstanceRequest. #
|
|
121
|
+
noqa: E501
|
|
105
122
|
:rtype: str
|
|
106
123
|
"""
|
|
107
124
|
return self._instance_slug
|
|
@@ -110,9 +127,11 @@ class ModelNewInstanceRequest(object):
|
|
|
110
127
|
def instance_slug(self, instance_slug):
|
|
111
128
|
"""Sets the instance_slug of this ModelNewInstanceRequest.
|
|
112
129
|
|
|
113
|
-
The slug that the model instance should be created with # noqa:
|
|
130
|
+
The slug that the model instance should be created with # noqa:
|
|
131
|
+
E501
|
|
114
132
|
|
|
115
|
-
:param instance_slug: The instance_slug of this
|
|
133
|
+
:param instance_slug: The instance_slug of this
|
|
134
|
+
ModelNewInstanceRequest. # noqa: E501
|
|
116
135
|
:type: str
|
|
117
136
|
"""
|
|
118
137
|
if instance_slug is None:
|
|
@@ -122,11 +141,12 @@ class ModelNewInstanceRequest(object):
|
|
|
122
141
|
|
|
123
142
|
@property
|
|
124
143
|
def framework(self):
|
|
125
|
-
"""Gets the framework of this ModelNewInstanceRequest. # noqa: E501
|
|
144
|
+
"""Gets the framework of this ModelNewInstanceRequest. # noqa: E501.
|
|
126
145
|
|
|
127
146
|
The framework of the model instance # noqa: E501
|
|
128
147
|
|
|
129
|
-
:return: The framework of this ModelNewInstanceRequest.
|
|
148
|
+
:return: The framework of this ModelNewInstanceRequest. # noqa:
|
|
149
|
+
E501
|
|
130
150
|
:rtype: str
|
|
131
151
|
"""
|
|
132
152
|
return self._framework
|
|
@@ -137,27 +157,55 @@ class ModelNewInstanceRequest(object):
|
|
|
137
157
|
|
|
138
158
|
The framework of the model instance # noqa: E501
|
|
139
159
|
|
|
140
|
-
:param framework: The framework of this ModelNewInstanceRequest.
|
|
160
|
+
:param framework: The framework of this ModelNewInstanceRequest.
|
|
161
|
+
# noqa: E501
|
|
141
162
|
:type: str
|
|
142
163
|
"""
|
|
143
164
|
if framework is None:
|
|
144
165
|
raise ValueError("Invalid value for `framework`, must not be `None`") # noqa: E501
|
|
145
|
-
allowed_values = [
|
|
166
|
+
allowed_values = [
|
|
167
|
+
"tensorFlow1",
|
|
168
|
+
"tensorFlow2",
|
|
169
|
+
"tfLite",
|
|
170
|
+
"tfJs",
|
|
171
|
+
"pyTorch",
|
|
172
|
+
"jax",
|
|
173
|
+
"flax",
|
|
174
|
+
"pax",
|
|
175
|
+
"maxText",
|
|
176
|
+
"gemmaCpp",
|
|
177
|
+
"tensorRtLlm",
|
|
178
|
+
"ggml",
|
|
179
|
+
"gguf",
|
|
180
|
+
"coral",
|
|
181
|
+
"scikitLearn",
|
|
182
|
+
"mxnet",
|
|
183
|
+
"onnx",
|
|
184
|
+
"keras",
|
|
185
|
+
"transformers",
|
|
186
|
+
"triton",
|
|
187
|
+
"api",
|
|
188
|
+
"triton",
|
|
189
|
+
"tensorRtLlm",
|
|
190
|
+
"other",
|
|
191
|
+
] # noqa: E501
|
|
146
192
|
if framework not in allowed_values:
|
|
147
193
|
raise ValueError(
|
|
148
|
-
"Invalid value for `framework` ({0}), must be one of {1}" # noqa: E501
|
|
149
|
-
|
|
194
|
+
"Invalid value for `framework` ({0}), must be one of {1}".format( # noqa: E501
|
|
195
|
+
framework, allowed_values
|
|
196
|
+
)
|
|
150
197
|
)
|
|
151
198
|
|
|
152
199
|
self._framework = framework
|
|
153
200
|
|
|
154
201
|
@property
|
|
155
202
|
def overview(self):
|
|
156
|
-
"""Gets the overview of this ModelNewInstanceRequest. # noqa: E501
|
|
203
|
+
"""Gets the overview of this ModelNewInstanceRequest. # noqa: E501.
|
|
157
204
|
|
|
158
205
|
The overview of the model instance (markdown) # noqa: E501
|
|
159
206
|
|
|
160
|
-
:return: The overview of this ModelNewInstanceRequest.
|
|
207
|
+
:return: The overview of this ModelNewInstanceRequest. # noqa:
|
|
208
|
+
E501
|
|
161
209
|
:rtype: str
|
|
162
210
|
"""
|
|
163
211
|
return self._overview
|
|
@@ -168,7 +216,8 @@ class ModelNewInstanceRequest(object):
|
|
|
168
216
|
|
|
169
217
|
The overview of the model instance (markdown) # noqa: E501
|
|
170
218
|
|
|
171
|
-
:param overview: The overview of this ModelNewInstanceRequest.
|
|
219
|
+
:param overview: The overview of this ModelNewInstanceRequest. #
|
|
220
|
+
noqa: E501
|
|
172
221
|
:type: str
|
|
173
222
|
"""
|
|
174
223
|
|
|
@@ -176,11 +225,13 @@ class ModelNewInstanceRequest(object):
|
|
|
176
225
|
|
|
177
226
|
@property
|
|
178
227
|
def usage(self):
|
|
179
|
-
"""Gets the usage of this ModelNewInstanceRequest. # noqa: E501
|
|
228
|
+
"""Gets the usage of this ModelNewInstanceRequest. # noqa: E501.
|
|
180
229
|
|
|
181
|
-
The description of how to use the model instance (markdown) #
|
|
230
|
+
The description of how to use the model instance (markdown) #
|
|
231
|
+
noqa: E501
|
|
182
232
|
|
|
183
|
-
:return: The usage of this ModelNewInstanceRequest.
|
|
233
|
+
:return: The usage of this ModelNewInstanceRequest. # noqa:
|
|
234
|
+
E501
|
|
184
235
|
:rtype: str
|
|
185
236
|
"""
|
|
186
237
|
return self._usage
|
|
@@ -189,9 +240,11 @@ class ModelNewInstanceRequest(object):
|
|
|
189
240
|
def usage(self, usage):
|
|
190
241
|
"""Sets the usage of this ModelNewInstanceRequest.
|
|
191
242
|
|
|
192
|
-
The description of how to use the model instance (markdown) #
|
|
243
|
+
The description of how to use the model instance (markdown) #
|
|
244
|
+
noqa: E501
|
|
193
245
|
|
|
194
|
-
:param usage: The usage of this ModelNewInstanceRequest.
|
|
246
|
+
:param usage: The usage of this ModelNewInstanceRequest. #
|
|
247
|
+
noqa: E501
|
|
195
248
|
:type: str
|
|
196
249
|
"""
|
|
197
250
|
|
|
@@ -199,11 +252,14 @@ class ModelNewInstanceRequest(object):
|
|
|
199
252
|
|
|
200
253
|
@property
|
|
201
254
|
def license_name(self):
|
|
202
|
-
"""Gets the license_name of this ModelNewInstanceRequest. # noqa:
|
|
255
|
+
"""Gets the license_name of this ModelNewInstanceRequest. # noqa:
|
|
256
|
+
E501.
|
|
203
257
|
|
|
204
|
-
The license that should be associated with the model instance #
|
|
258
|
+
The license that should be associated with the model instance #
|
|
259
|
+
noqa: E501
|
|
205
260
|
|
|
206
|
-
:return: The license_name of this ModelNewInstanceRequest.
|
|
261
|
+
:return: The license_name of this ModelNewInstanceRequest. #
|
|
262
|
+
noqa: E501
|
|
207
263
|
:rtype: str
|
|
208
264
|
"""
|
|
209
265
|
return self._license_name
|
|
@@ -212,29 +268,92 @@ class ModelNewInstanceRequest(object):
|
|
|
212
268
|
def license_name(self, license_name):
|
|
213
269
|
"""Sets the license_name of this ModelNewInstanceRequest.
|
|
214
270
|
|
|
215
|
-
The license that should be associated with the model instance #
|
|
271
|
+
The license that should be associated with the model instance #
|
|
272
|
+
noqa: E501
|
|
216
273
|
|
|
217
|
-
:param license_name: The license_name of this
|
|
274
|
+
:param license_name: The license_name of this
|
|
275
|
+
ModelNewInstanceRequest. # noqa: E501
|
|
218
276
|
:type: str
|
|
219
277
|
"""
|
|
220
278
|
if license_name is None:
|
|
221
279
|
raise ValueError("Invalid value for `license_name`, must not be `None`") # noqa: E501
|
|
222
|
-
allowed_values = [
|
|
280
|
+
allowed_values = [
|
|
281
|
+
"CC0 1.0",
|
|
282
|
+
"CC BY-NC-SA 4.0",
|
|
283
|
+
"Unknown",
|
|
284
|
+
"CC BY-SA 4.0",
|
|
285
|
+
"GPL 2",
|
|
286
|
+
"CC BY-SA 3.0",
|
|
287
|
+
"Other",
|
|
288
|
+
"Other (specified in description)",
|
|
289
|
+
"CC BY 4.0",
|
|
290
|
+
"Attribution 4.0 International (CC BY 4.0)",
|
|
291
|
+
"CC BY-NC 4.0",
|
|
292
|
+
"Attribution-NonCommercial 4.0 International (CC BY-NC 4.0)",
|
|
293
|
+
"PDDL",
|
|
294
|
+
"ODC Public Domain Dedication and Licence (PDDL)",
|
|
295
|
+
"CC BY 3.0",
|
|
296
|
+
"Attribution 3.0 Unported (CC BY 3.0)",
|
|
297
|
+
"CC BY 3.0 IGO",
|
|
298
|
+
"Attribution 3.0 IGO (CC BY 3.0 IGO)",
|
|
299
|
+
"CC BY-NC-SA 3.0 IGO",
|
|
300
|
+
"Attribution-NonCommercial-ShareAlike 3.0 IGO (CC BY-NC-SA 3.0 IGO)",
|
|
301
|
+
"CDLA Permissive 1.0",
|
|
302
|
+
"Community Data License Agreement - Permissive - Version 1.0",
|
|
303
|
+
"CDLA Sharing 1.0",
|
|
304
|
+
"Community Data License Agreement - Sharing - Version 1.0",
|
|
305
|
+
"CC BY-ND 4.0",
|
|
306
|
+
"Attribution-NoDerivatives 4.0 International (CC BY-ND 4.0)",
|
|
307
|
+
"CC BY-NC-ND 4.0",
|
|
308
|
+
"Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0)",
|
|
309
|
+
"ODC-BY 1.0",
|
|
310
|
+
"ODC Attribution License (ODC-By)",
|
|
311
|
+
"LGPL 3.0",
|
|
312
|
+
"GNU Lesser General Public License 3.0",
|
|
313
|
+
"AGPL 3.0",
|
|
314
|
+
"GNU Affero General Public License 3.0",
|
|
315
|
+
"FDL 1.3",
|
|
316
|
+
"GNU Free Documentation License 1.3",
|
|
317
|
+
"apache-2.0",
|
|
318
|
+
"Apache 2.0",
|
|
319
|
+
"mit",
|
|
320
|
+
"MIT",
|
|
321
|
+
"bsd-3-clause",
|
|
322
|
+
"BSD-3-Clause",
|
|
323
|
+
"Llama 2",
|
|
324
|
+
"Llama 2 Community License",
|
|
325
|
+
"Gemma",
|
|
326
|
+
"gpl-3",
|
|
327
|
+
"GPL 3",
|
|
328
|
+
"RAIL-M",
|
|
329
|
+
"AI Pubs Open RAIL-M License",
|
|
330
|
+
"AIPubs Research-Use RAIL-M",
|
|
331
|
+
"AI Pubs Research-Use RAIL-M License",
|
|
332
|
+
"BigScience OpenRAIL-M",
|
|
333
|
+
"BigScience Open RAIL-M License",
|
|
334
|
+
"RAIL",
|
|
335
|
+
"RAIL (specified in description)",
|
|
336
|
+
"Llama 3",
|
|
337
|
+
"Llama 3 Community License",
|
|
338
|
+
] # noqa: E501
|
|
223
339
|
if license_name not in allowed_values:
|
|
224
340
|
raise ValueError(
|
|
225
|
-
"Invalid value for `license_name` ({0}), must be one of {1}" # noqa: E501
|
|
226
|
-
|
|
341
|
+
"Invalid value for `license_name` ({0}), must be one of {1}".format( # noqa: E501
|
|
342
|
+
license_name, allowed_values
|
|
343
|
+
)
|
|
227
344
|
)
|
|
228
345
|
|
|
229
346
|
self._license_name = license_name
|
|
230
347
|
|
|
231
348
|
@property
|
|
232
349
|
def fine_tunable(self):
|
|
233
|
-
"""Gets the fine_tunable of this ModelNewInstanceRequest. # noqa:
|
|
350
|
+
"""Gets the fine_tunable of this ModelNewInstanceRequest. # noqa:
|
|
351
|
+
E501.
|
|
234
352
|
|
|
235
353
|
Whether the model instance is fine tunable # noqa: E501
|
|
236
354
|
|
|
237
|
-
:return: The fine_tunable of this ModelNewInstanceRequest.
|
|
355
|
+
:return: The fine_tunable of this ModelNewInstanceRequest. #
|
|
356
|
+
noqa: E501
|
|
238
357
|
:rtype: bool
|
|
239
358
|
"""
|
|
240
359
|
return self._fine_tunable
|
|
@@ -245,7 +364,8 @@ class ModelNewInstanceRequest(object):
|
|
|
245
364
|
|
|
246
365
|
Whether the model instance is fine tunable # noqa: E501
|
|
247
366
|
|
|
248
|
-
:param fine_tunable: The fine_tunable of this
|
|
367
|
+
:param fine_tunable: The fine_tunable of this
|
|
368
|
+
ModelNewInstanceRequest. # noqa: E501
|
|
249
369
|
:type: bool
|
|
250
370
|
"""
|
|
251
371
|
|
|
@@ -253,11 +373,13 @@ class ModelNewInstanceRequest(object):
|
|
|
253
373
|
|
|
254
374
|
@property
|
|
255
375
|
def training_data(self):
|
|
256
|
-
"""Gets the training_data of this ModelNewInstanceRequest. # noqa:
|
|
376
|
+
"""Gets the training_data of this ModelNewInstanceRequest. # noqa:
|
|
377
|
+
E501.
|
|
257
378
|
|
|
258
379
|
A list of training data (urls or names) # noqa: E501
|
|
259
380
|
|
|
260
|
-
:return: The training_data of this ModelNewInstanceRequest.
|
|
381
|
+
:return: The training_data of this ModelNewInstanceRequest. #
|
|
382
|
+
noqa: E501
|
|
261
383
|
:rtype: list[str]
|
|
262
384
|
"""
|
|
263
385
|
return self._training_data
|
|
@@ -268,7 +390,8 @@ class ModelNewInstanceRequest(object):
|
|
|
268
390
|
|
|
269
391
|
A list of training data (urls or names) # noqa: E501
|
|
270
392
|
|
|
271
|
-
:param training_data: The training_data of this
|
|
393
|
+
:param training_data: The training_data of this
|
|
394
|
+
ModelNewInstanceRequest. # noqa: E501
|
|
272
395
|
:type: list[str]
|
|
273
396
|
"""
|
|
274
397
|
|
|
@@ -276,11 +399,14 @@ class ModelNewInstanceRequest(object):
|
|
|
276
399
|
|
|
277
400
|
@property
|
|
278
401
|
def model_instance_type(self):
|
|
279
|
-
"""Gets the model_instance_type of this ModelNewInstanceRequest. #
|
|
402
|
+
"""Gets the model_instance_type of this ModelNewInstanceRequest. #
|
|
403
|
+
noqa: E501.
|
|
280
404
|
|
|
281
|
-
Whether the model instance is a base model, external variant,
|
|
405
|
+
Whether the model instance is a base model, external variant,
|
|
406
|
+
internal variant, or unspecified # noqa: E501
|
|
282
407
|
|
|
283
|
-
:return: The model_instance_type of this
|
|
408
|
+
:return: The model_instance_type of this
|
|
409
|
+
ModelNewInstanceRequest. # noqa: E501
|
|
284
410
|
:rtype: str
|
|
285
411
|
"""
|
|
286
412
|
return self._model_instance_type
|
|
@@ -289,23 +415,27 @@ class ModelNewInstanceRequest(object):
|
|
|
289
415
|
def model_instance_type(self, model_instance_type):
|
|
290
416
|
"""Sets the model_instance_type of this ModelNewInstanceRequest.
|
|
291
417
|
|
|
292
|
-
Whether the model instance is a base model, external variant,
|
|
418
|
+
Whether the model instance is a base model, external variant,
|
|
419
|
+
internal variant, or unspecified # noqa: E501
|
|
293
420
|
|
|
294
|
-
:param model_instance_type: The model_instance_type of this
|
|
421
|
+
:param model_instance_type: The model_instance_type of this
|
|
422
|
+
ModelNewInstanceRequest. # noqa: E501
|
|
295
423
|
:type: str
|
|
296
424
|
"""
|
|
297
425
|
allowed_values = ["Unspecified", "BaseModel", "KaggleVariant", "ExternalVariant"] # noqa: E501
|
|
298
426
|
if model_instance_type not in allowed_values:
|
|
299
427
|
raise ValueError(
|
|
300
|
-
"Invalid value for `model_instance_type` ({0}), must be one of {1}" # noqa: E501
|
|
301
|
-
|
|
428
|
+
"Invalid value for `model_instance_type` ({0}), must be one of {1}".format( # noqa: E501
|
|
429
|
+
model_instance_type, allowed_values
|
|
430
|
+
)
|
|
302
431
|
)
|
|
303
432
|
|
|
304
433
|
self._model_instance_type = model_instance_type
|
|
305
434
|
|
|
306
435
|
@property
|
|
307
436
|
def base_model_instance(self):
|
|
308
|
-
"""Gets the base_model_instance of this ModelNewInstanceRequest. #
|
|
437
|
+
"""Gets the base_model_instance of this ModelNewInstanceRequest. #
|
|
438
|
+
noqa: E501.
|
|
309
439
|
|
|
310
440
|
If this is an internal variant, the `{owner-slug}/{model-slug}/{framework}/{instance-slug}` of the base model instance # noqa: E501
|
|
311
441
|
|
|
@@ -328,11 +458,14 @@ class ModelNewInstanceRequest(object):
|
|
|
328
458
|
|
|
329
459
|
@property
|
|
330
460
|
def external_base_model_url(self):
|
|
331
|
-
"""Gets the external_base_model_url of this ModelNewInstanceRequest. #
|
|
461
|
+
"""Gets the external_base_model_url of this ModelNewInstanceRequest. #
|
|
462
|
+
noqa: E501.
|
|
332
463
|
|
|
333
|
-
If this is an external variant, a URL to the base model # noqa:
|
|
464
|
+
If this is an external variant, a URL to the base model # noqa:
|
|
465
|
+
E501
|
|
334
466
|
|
|
335
|
-
:return: The external_base_model_url of this
|
|
467
|
+
:return: The external_base_model_url of this
|
|
468
|
+
ModelNewInstanceRequest. # noqa: E501
|
|
336
469
|
:rtype: int
|
|
337
470
|
"""
|
|
338
471
|
return self._external_base_model_url
|
|
@@ -341,9 +474,11 @@ class ModelNewInstanceRequest(object):
|
|
|
341
474
|
def external_base_model_url(self, external_base_model_url):
|
|
342
475
|
"""Sets the external_base_model_url of this ModelNewInstanceRequest.
|
|
343
476
|
|
|
344
|
-
If this is an external variant, a URL to the base model # noqa:
|
|
477
|
+
If this is an external variant, a URL to the base model # noqa:
|
|
478
|
+
E501
|
|
345
479
|
|
|
346
|
-
:param external_base_model_url: The external_base_model_url of
|
|
480
|
+
:param external_base_model_url: The external_base_model_url of
|
|
481
|
+
this ModelNewInstanceRequest. # noqa: E501
|
|
347
482
|
:type: int
|
|
348
483
|
"""
|
|
349
484
|
|
|
@@ -351,11 +486,12 @@ class ModelNewInstanceRequest(object):
|
|
|
351
486
|
|
|
352
487
|
@property
|
|
353
488
|
def files(self):
|
|
354
|
-
"""Gets the files of this ModelNewInstanceRequest. # noqa: E501
|
|
489
|
+
"""Gets the files of this ModelNewInstanceRequest. # noqa: E501.
|
|
355
490
|
|
|
356
|
-
A list of files that should be associated with the model
|
|
491
|
+
A list of files that should be associated with the model
|
|
492
|
+
instance version # noqa: E501
|
|
357
493
|
|
|
358
|
-
:return: The files of this ModelNewInstanceRequest.
|
|
494
|
+
:return: The files of this ModelNewInstanceRequest. # noqa: E501
|
|
359
495
|
:rtype: list[UploadFile]
|
|
360
496
|
"""
|
|
361
497
|
return self._files
|
|
@@ -364,40 +500,40 @@ class ModelNewInstanceRequest(object):
|
|
|
364
500
|
def files(self, files):
|
|
365
501
|
"""Sets the files of this ModelNewInstanceRequest.
|
|
366
502
|
|
|
367
|
-
A list of files that should be associated with the model
|
|
503
|
+
A list of files that should be associated with the model
|
|
504
|
+
instance version # noqa: E501
|
|
368
505
|
|
|
369
|
-
:param files: The files of this ModelNewInstanceRequest.
|
|
506
|
+
:param files: The files of this ModelNewInstanceRequest. #
|
|
507
|
+
noqa: E501
|
|
370
508
|
:type: list[UploadFile]
|
|
371
509
|
"""
|
|
372
510
|
|
|
373
511
|
self._files = files
|
|
374
512
|
|
|
375
513
|
def to_dict(self):
|
|
376
|
-
"""Returns the model properties as a dict"""
|
|
514
|
+
"""Returns the model properties as a dict."""
|
|
377
515
|
result = {}
|
|
378
516
|
|
|
379
517
|
for attr, _ in six.iteritems(self.project_types):
|
|
380
518
|
value = getattr(self, attr)
|
|
381
519
|
if isinstance(value, list):
|
|
382
|
-
result[attr] = list(map(
|
|
383
|
-
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
|
384
|
-
value
|
|
385
|
-
))
|
|
520
|
+
result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value))
|
|
386
521
|
elif hasattr(value, "to_dict"):
|
|
387
522
|
result[attr] = value.to_dict()
|
|
388
523
|
elif isinstance(value, dict):
|
|
389
|
-
result[attr] = dict(
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
524
|
+
result[attr] = dict(
|
|
525
|
+
map(
|
|
526
|
+
lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item,
|
|
527
|
+
value.items(),
|
|
528
|
+
)
|
|
529
|
+
)
|
|
394
530
|
else:
|
|
395
531
|
result[attr] = value
|
|
396
532
|
|
|
397
533
|
return result
|
|
398
534
|
|
|
399
535
|
def to_str(self):
|
|
400
|
-
"""Returns the string representation of the model"""
|
|
536
|
+
"""Returns the string representation of the model."""
|
|
401
537
|
return pprint.pformat(self.to_dict())
|
|
402
538
|
|
|
403
539
|
def __repr__(self):
|
|
@@ -405,13 +541,12 @@ class ModelNewInstanceRequest(object):
|
|
|
405
541
|
return self.to_str()
|
|
406
542
|
|
|
407
543
|
def __eq__(self, other):
|
|
408
|
-
"""Returns true if both objects are equal"""
|
|
544
|
+
"""Returns true if both objects are equal."""
|
|
409
545
|
if not isinstance(other, ModelNewInstanceRequest):
|
|
410
546
|
return False
|
|
411
547
|
|
|
412
548
|
return self.__dict__ == other.__dict__
|
|
413
549
|
|
|
414
550
|
def __ne__(self, other):
|
|
415
|
-
"""Returns true if both objects are not equal"""
|
|
551
|
+
"""Returns true if both objects are not equal."""
|
|
416
552
|
return not self == other
|
|
417
|
-
|