kaggle 1.7.4.5__py3-none-any.whl → 1.8.2__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 -598
- kaggle/api/kaggle_api_extended.py +5251 -4769
- kaggle/cli.py +1335 -1585
- kaggle/models/api_blob_type.py +3 -3
- kaggle/models/dataset_column.py +165 -174
- kaggle/models/dataset_new_request.py +83 -41
- kaggle/models/dataset_new_version_request.py +32 -25
- kaggle/models/dataset_update_settings_request.py +35 -27
- kaggle/models/kaggle_models_extended.py +169 -172
- kaggle/models/kernel_push_request.py +66 -49
- kaggle/models/model_instance_new_version_request.py +10 -18
- kaggle/models/model_instance_update_request.py +103 -34
- kaggle/models/model_new_instance_request.py +138 -41
- kaggle/models/model_new_request.py +35 -27
- kaggle/models/model_update_request.py +32 -25
- kaggle/models/start_blob_upload_request.py +192 -195
- kaggle/models/start_blob_upload_response.py +98 -98
- kaggle/models/upload_file.py +114 -120
- kaggle/test/test_authenticate.py +23 -23
- {kaggle-1.7.4.5.dist-info → kaggle-1.8.2.dist-info}/METADATA +12 -15
- kaggle-1.8.2.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 +554 -300
- 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 +46 -23
- kagglesdk/kaggle_creds.py +148 -0
- kagglesdk/kaggle_env.py +89 -25
- kagglesdk/kaggle_http_client.py +224 -306
- kagglesdk/kaggle_oauth.py +200 -0
- kagglesdk/kaggle_object.py +286 -293
- kagglesdk/kernels/services/kernels_api_service.py +46 -9
- kagglesdk/kernels/types/kernels_api_service.py +635 -159
- 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 +41 -17
- kagglesdk/models/types/model_api_service.py +987 -637
- 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/services/iam_service.py +31 -0
- kagglesdk/security/services/oauth_service.py +27 -1
- kagglesdk/security/types/authentication.py +63 -63
- kagglesdk/security/types/iam_service.py +496 -0
- kagglesdk/security/types/oauth_service.py +797 -10
- 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 -22
- kagglesdk/users/services/account_service.py +13 -1
- kagglesdk/users/services/group_api_service.py +31 -0
- kagglesdk/users/types/account_service.py +169 -28
- 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.5.dist-info/RECORD +0 -98
- {kaggle-1.7.4.5.dist-info → kaggle-1.8.2.dist-info}/WHEEL +0 -0
- {kaggle-1.7.4.5.dist-info → kaggle-1.8.2.dist-info}/entry_points.txt +0 -0
- {kaggle-1.7.4.5.dist-info → kaggle-1.8.2.dist-info}/licenses/LICENSE.txt +0 -0
- {kaggle/test → kagglesdk/benchmarks}/__init__.py +0 -0
|
@@ -31,45 +31,64 @@ class KernelPushRequest(object):
|
|
|
31
31
|
attribute_map (dict): The key is attribute name
|
|
32
32
|
and the value is json key in definition.
|
|
33
33
|
"""
|
|
34
|
+
|
|
34
35
|
project_types = {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
36
|
+
"id": "int",
|
|
37
|
+
"slug": "str",
|
|
38
|
+
"new_title": "str",
|
|
39
|
+
"text": "str",
|
|
40
|
+
"language": "str",
|
|
41
|
+
"kernel_type": "str",
|
|
42
|
+
"is_private": "bool",
|
|
43
|
+
"enable_gpu": "bool",
|
|
44
|
+
"enable_tpu": "bool",
|
|
45
|
+
"enable_internet": "bool",
|
|
46
|
+
"dataset_data_sources": "list[str]",
|
|
47
|
+
"competition_data_sources": "list[str]",
|
|
48
|
+
"kernel_data_sources": "list[str]",
|
|
49
|
+
"model_data_sources": "list[str]",
|
|
50
|
+
"category_ids": "list[str]",
|
|
51
|
+
"docker_image_pinning_type": "str",
|
|
51
52
|
}
|
|
52
53
|
|
|
53
54
|
attribute_map = {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
55
|
+
"id": "id",
|
|
56
|
+
"slug": "slug",
|
|
57
|
+
"new_title": "newTitle",
|
|
58
|
+
"text": "text",
|
|
59
|
+
"language": "language",
|
|
60
|
+
"kernel_type": "kernelType",
|
|
61
|
+
"is_private": "isPrivate",
|
|
62
|
+
"enable_gpu": "enableGpu",
|
|
63
|
+
"enable_tpu": "enableTpu",
|
|
64
|
+
"enable_internet": "enableInternet",
|
|
65
|
+
"dataset_data_sources": "datasetDataSources",
|
|
66
|
+
"competition_data_sources": "competitionDataSources",
|
|
67
|
+
"kernel_data_sources": "kernelDataSources",
|
|
68
|
+
"model_data_sources": "modelDataSources",
|
|
69
|
+
"category_ids": "categoryIds",
|
|
70
|
+
"docker_image_pinning_type": "dockerImagePinningType",
|
|
70
71
|
}
|
|
71
72
|
|
|
72
|
-
def __init__(
|
|
73
|
+
def __init__(
|
|
74
|
+
self,
|
|
75
|
+
id=None,
|
|
76
|
+
slug=None,
|
|
77
|
+
new_title=None,
|
|
78
|
+
text=None,
|
|
79
|
+
language=None,
|
|
80
|
+
kernel_type=None,
|
|
81
|
+
is_private=None,
|
|
82
|
+
enable_gpu=None,
|
|
83
|
+
enable_tpu=None,
|
|
84
|
+
enable_internet=None,
|
|
85
|
+
dataset_data_sources=None,
|
|
86
|
+
competition_data_sources=None,
|
|
87
|
+
kernel_data_sources=None,
|
|
88
|
+
model_data_sources=None,
|
|
89
|
+
category_ids=None,
|
|
90
|
+
docker_image_pinning_type=None,
|
|
91
|
+
): # noqa: E501
|
|
73
92
|
|
|
74
93
|
self._id = None
|
|
75
94
|
self._slug = None
|
|
@@ -240,8 +259,7 @@ class KernelPushRequest(object):
|
|
|
240
259
|
allowed_values = ["python", "r", "rmarkdown"] # noqa: E501
|
|
241
260
|
if language not in allowed_values:
|
|
242
261
|
raise ValueError(
|
|
243
|
-
"Invalid value for `language` ({0}), must be one of {1}" # noqa: E501
|
|
244
|
-
.format(language, allowed_values)
|
|
262
|
+
"Invalid value for `language` ({0}), must be one of {1}".format(language, allowed_values) # noqa: E501
|
|
245
263
|
)
|
|
246
264
|
|
|
247
265
|
self._language = language
|
|
@@ -274,8 +292,9 @@ class KernelPushRequest(object):
|
|
|
274
292
|
allowed_values = ["script", "notebook"] # noqa: E501
|
|
275
293
|
if kernel_type not in allowed_values:
|
|
276
294
|
raise ValueError(
|
|
277
|
-
"Invalid value for `kernel_type` ({0}), must be one of {1}" # noqa: E501
|
|
278
|
-
|
|
295
|
+
"Invalid value for `kernel_type` ({0}), must be one of {1}".format( # noqa: E501
|
|
296
|
+
kernel_type, allowed_values
|
|
297
|
+
)
|
|
279
298
|
)
|
|
280
299
|
|
|
281
300
|
self._kernel_type = kernel_type
|
|
@@ -540,8 +559,9 @@ class KernelPushRequest(object):
|
|
|
540
559
|
allowed_values = ["original", "latest"] # noqa: E501
|
|
541
560
|
if docker_image_pinning_type not in allowed_values:
|
|
542
561
|
raise ValueError(
|
|
543
|
-
"Invalid value for `docker_image_pinning_type` ({0}), must be one of {1}" # noqa: E501
|
|
544
|
-
|
|
562
|
+
"Invalid value for `docker_image_pinning_type` ({0}), must be one of {1}".format( # noqa: E501
|
|
563
|
+
docker_image_pinning_type, allowed_values
|
|
564
|
+
)
|
|
545
565
|
)
|
|
546
566
|
|
|
547
567
|
self._docker_image_pinning_type = docker_image_pinning_type
|
|
@@ -553,18 +573,16 @@ class KernelPushRequest(object):
|
|
|
553
573
|
for attr, _ in six.iteritems(self.project_types):
|
|
554
574
|
value = getattr(self, attr)
|
|
555
575
|
if isinstance(value, list):
|
|
556
|
-
result[attr] = list(map(
|
|
557
|
-
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
|
558
|
-
value
|
|
559
|
-
))
|
|
576
|
+
result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value))
|
|
560
577
|
elif hasattr(value, "to_dict"):
|
|
561
578
|
result[attr] = value.to_dict()
|
|
562
579
|
elif isinstance(value, dict):
|
|
563
|
-
result[attr] = dict(
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
580
|
+
result[attr] = dict(
|
|
581
|
+
map(
|
|
582
|
+
lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item,
|
|
583
|
+
value.items(),
|
|
584
|
+
)
|
|
585
|
+
)
|
|
568
586
|
else:
|
|
569
587
|
result[attr] = value
|
|
570
588
|
|
|
@@ -588,4 +606,3 @@ class KernelPushRequest(object):
|
|
|
588
606
|
def __ne__(self, other):
|
|
589
607
|
"""Returns true if both objects are not equal."""
|
|
590
608
|
return not self == other
|
|
591
|
-
|
|
@@ -32,15 +32,10 @@ class ModelInstanceNewVersionRequest(object):
|
|
|
32
32
|
attribute_map (dict): The key is attribute name
|
|
33
33
|
and the value is json key in definition.
|
|
34
34
|
"""
|
|
35
|
-
project_types = {
|
|
36
|
-
'version_notes': 'str',
|
|
37
|
-
'files': 'list[UploadFile]'
|
|
38
|
-
}
|
|
39
35
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
36
|
+
project_types = {"version_notes": "str", "files": "list[UploadFile]"}
|
|
37
|
+
|
|
38
|
+
attribute_map = {"version_notes": "versionNotes", "files": "files"}
|
|
44
39
|
|
|
45
40
|
def __init__(self, version_notes=None, files=None): # noqa: E501
|
|
46
41
|
|
|
@@ -115,18 +110,16 @@ class ModelInstanceNewVersionRequest(object):
|
|
|
115
110
|
for attr, _ in six.iteritems(self.project_types):
|
|
116
111
|
value = getattr(self, attr)
|
|
117
112
|
if isinstance(value, list):
|
|
118
|
-
result[attr] = list(map(
|
|
119
|
-
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
|
120
|
-
value
|
|
121
|
-
))
|
|
113
|
+
result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value))
|
|
122
114
|
elif hasattr(value, "to_dict"):
|
|
123
115
|
result[attr] = value.to_dict()
|
|
124
116
|
elif isinstance(value, dict):
|
|
125
|
-
result[attr] = dict(
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
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
|
+
)
|
|
130
123
|
else:
|
|
131
124
|
result[attr] = value
|
|
132
125
|
|
|
@@ -150,4 +143,3 @@ class ModelInstanceNewVersionRequest(object):
|
|
|
150
143
|
def __ne__(self, other):
|
|
151
144
|
"""Returns true if both objects are not equal."""
|
|
152
145
|
return not self == other
|
|
153
|
-
|
|
@@ -30,31 +30,43 @@ class ModelInstanceUpdateRequest(object):
|
|
|
30
30
|
attribute_map (dict): The key is attribute name
|
|
31
31
|
and the value is json key in definition.
|
|
32
32
|
"""
|
|
33
|
+
|
|
33
34
|
project_types = {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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",
|
|
43
44
|
}
|
|
44
45
|
|
|
45
46
|
attribute_map = {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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",
|
|
55
56
|
}
|
|
56
57
|
|
|
57
|
-
def __init__(
|
|
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
|
|
58
70
|
|
|
59
71
|
self._overview = None
|
|
60
72
|
self._usage = None
|
|
@@ -162,11 +174,70 @@ class ModelInstanceUpdateRequest(object):
|
|
|
162
174
|
ModelInstanceUpdateRequest. # noqa: E501
|
|
163
175
|
:type: str
|
|
164
176
|
"""
|
|
165
|
-
allowed_values = [
|
|
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
|
|
166
236
|
if license_name not in allowed_values:
|
|
167
237
|
raise ValueError(
|
|
168
|
-
"Invalid value for `license_name` ({0}), must be one of {1}" # noqa: E501
|
|
169
|
-
|
|
238
|
+
"Invalid value for `license_name` ({0}), must be one of {1}".format( # noqa: E501
|
|
239
|
+
license_name, allowed_values
|
|
240
|
+
)
|
|
170
241
|
)
|
|
171
242
|
|
|
172
243
|
self._license_name = license_name
|
|
@@ -251,8 +322,9 @@ class ModelInstanceUpdateRequest(object):
|
|
|
251
322
|
allowed_values = ["Unspecified", "BaseModel", "KaggleVariant", "ExternalVariant"] # noqa: E501
|
|
252
323
|
if model_instance_type not in allowed_values:
|
|
253
324
|
raise ValueError(
|
|
254
|
-
"Invalid value for `model_instance_type` ({0}), must be one of {1}" # noqa: E501
|
|
255
|
-
|
|
325
|
+
"Invalid value for `model_instance_type` ({0}), must be one of {1}".format( # noqa: E501
|
|
326
|
+
model_instance_type, allowed_values
|
|
327
|
+
)
|
|
256
328
|
)
|
|
257
329
|
|
|
258
330
|
self._model_instance_type = model_instance_type
|
|
@@ -344,18 +416,16 @@ class ModelInstanceUpdateRequest(object):
|
|
|
344
416
|
for attr, _ in six.iteritems(self.project_types):
|
|
345
417
|
value = getattr(self, attr)
|
|
346
418
|
if isinstance(value, list):
|
|
347
|
-
result[attr] = list(map(
|
|
348
|
-
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
|
349
|
-
value
|
|
350
|
-
))
|
|
419
|
+
result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value))
|
|
351
420
|
elif hasattr(value, "to_dict"):
|
|
352
421
|
result[attr] = value.to_dict()
|
|
353
422
|
elif isinstance(value, dict):
|
|
354
|
-
result[attr] = dict(
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
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
|
+
)
|
|
359
429
|
else:
|
|
360
430
|
result[attr] = value
|
|
361
431
|
|
|
@@ -379,4 +449,3 @@ class ModelInstanceUpdateRequest(object):
|
|
|
379
449
|
def __ne__(self, other):
|
|
380
450
|
"""Returns true if both objects are not equal."""
|
|
381
451
|
return not self == other
|
|
382
|
-
|
|
@@ -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
|
|
@@ -149,11 +163,37 @@ class ModelNewInstanceRequest(object):
|
|
|
149
163
|
"""
|
|
150
164
|
if framework is None:
|
|
151
165
|
raise ValueError("Invalid value for `framework`, must not be `None`") # noqa: E501
|
|
152
|
-
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
|
|
153
192
|
if framework not in allowed_values:
|
|
154
193
|
raise ValueError(
|
|
155
|
-
"Invalid value for `framework` ({0}), must be one of {1}" # noqa: E501
|
|
156
|
-
|
|
194
|
+
"Invalid value for `framework` ({0}), must be one of {1}".format( # noqa: E501
|
|
195
|
+
framework, allowed_values
|
|
196
|
+
)
|
|
157
197
|
)
|
|
158
198
|
|
|
159
199
|
self._framework = framework
|
|
@@ -237,11 +277,70 @@ class ModelNewInstanceRequest(object):
|
|
|
237
277
|
"""
|
|
238
278
|
if license_name is None:
|
|
239
279
|
raise ValueError("Invalid value for `license_name`, must not be `None`") # noqa: E501
|
|
240
|
-
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
|
|
241
339
|
if license_name not in allowed_values:
|
|
242
340
|
raise ValueError(
|
|
243
|
-
"Invalid value for `license_name` ({0}), must be one of {1}" # noqa: E501
|
|
244
|
-
|
|
341
|
+
"Invalid value for `license_name` ({0}), must be one of {1}".format( # noqa: E501
|
|
342
|
+
license_name, allowed_values
|
|
343
|
+
)
|
|
245
344
|
)
|
|
246
345
|
|
|
247
346
|
self._license_name = license_name
|
|
@@ -326,8 +425,9 @@ class ModelNewInstanceRequest(object):
|
|
|
326
425
|
allowed_values = ["Unspecified", "BaseModel", "KaggleVariant", "ExternalVariant"] # noqa: E501
|
|
327
426
|
if model_instance_type not in allowed_values:
|
|
328
427
|
raise ValueError(
|
|
329
|
-
"Invalid value for `model_instance_type` ({0}), must be one of {1}" # noqa: E501
|
|
330
|
-
|
|
428
|
+
"Invalid value for `model_instance_type` ({0}), must be one of {1}".format( # noqa: E501
|
|
429
|
+
model_instance_type, allowed_values
|
|
430
|
+
)
|
|
331
431
|
)
|
|
332
432
|
|
|
333
433
|
self._model_instance_type = model_instance_type
|
|
@@ -417,18 +517,16 @@ class ModelNewInstanceRequest(object):
|
|
|
417
517
|
for attr, _ in six.iteritems(self.project_types):
|
|
418
518
|
value = getattr(self, attr)
|
|
419
519
|
if isinstance(value, list):
|
|
420
|
-
result[attr] = list(map(
|
|
421
|
-
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
|
422
|
-
value
|
|
423
|
-
))
|
|
520
|
+
result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value))
|
|
424
521
|
elif hasattr(value, "to_dict"):
|
|
425
522
|
result[attr] = value.to_dict()
|
|
426
523
|
elif isinstance(value, dict):
|
|
427
|
-
result[attr] = dict(
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
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
|
+
)
|
|
432
530
|
else:
|
|
433
531
|
result[attr] = value
|
|
434
532
|
|
|
@@ -452,4 +550,3 @@ class ModelNewInstanceRequest(object):
|
|
|
452
550
|
def __ne__(self, other):
|
|
453
551
|
"""Returns true if both objects are not equal."""
|
|
454
552
|
return not self == other
|
|
455
|
-
|