kaggle 1.7.4.5__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.
Files changed (110) hide show
  1. kaggle/__init__.py +10 -6
  2. kaggle/api/kaggle_api.py +574 -598
  3. kaggle/api/kaggle_api_extended.py +5251 -4769
  4. kaggle/cli.py +1335 -1585
  5. kaggle/models/api_blob_type.py +3 -3
  6. kaggle/models/dataset_column.py +165 -174
  7. kaggle/models/dataset_new_request.py +83 -41
  8. kaggle/models/dataset_new_version_request.py +32 -25
  9. kaggle/models/dataset_update_settings_request.py +35 -27
  10. kaggle/models/kaggle_models_extended.py +169 -172
  11. kaggle/models/kernel_push_request.py +66 -49
  12. kaggle/models/model_instance_new_version_request.py +10 -18
  13. kaggle/models/model_instance_update_request.py +103 -34
  14. kaggle/models/model_new_instance_request.py +138 -41
  15. kaggle/models/model_new_request.py +35 -27
  16. kaggle/models/model_update_request.py +32 -25
  17. kaggle/models/start_blob_upload_request.py +192 -195
  18. kaggle/models/start_blob_upload_response.py +98 -98
  19. kaggle/models/upload_file.py +114 -120
  20. kaggle/test/test_authenticate.py +23 -23
  21. {kaggle-1.7.4.5.dist-info → kaggle-1.8.0.dist-info}/METADATA +11 -15
  22. kaggle-1.8.0.dist-info/RECORD +148 -0
  23. kagglesdk/__init__.py +5 -1
  24. kagglesdk/benchmarks/services/__init__.py +0 -0
  25. kagglesdk/benchmarks/services/benchmarks_api_service.py +19 -0
  26. kagglesdk/benchmarks/types/__init__.py +0 -0
  27. kagglesdk/benchmarks/types/benchmark_types.py +307 -0
  28. kagglesdk/benchmarks/types/benchmarks_api_service.py +243 -0
  29. kagglesdk/blobs/services/blob_api_service.py +1 -1
  30. kagglesdk/blobs/types/blob_api_service.py +2 -2
  31. kagglesdk/common/services/__init__.py +0 -0
  32. kagglesdk/common/services/operations_service.py +46 -0
  33. kagglesdk/common/types/file_download.py +1 -1
  34. kagglesdk/common/types/http_redirect.py +1 -1
  35. kagglesdk/common/types/operations.py +194 -0
  36. kagglesdk/common/types/operations_service.py +48 -0
  37. kagglesdk/community/__init__.py +0 -0
  38. kagglesdk/community/types/__init__.py +0 -0
  39. kagglesdk/community/types/content_enums.py +44 -0
  40. kagglesdk/community/types/organization.py +410 -0
  41. kagglesdk/competitions/services/competition_api_service.py +49 -12
  42. kagglesdk/competitions/types/competition.py +14 -0
  43. kagglesdk/competitions/types/competition_api_service.py +1639 -1275
  44. kagglesdk/competitions/types/search_competitions.py +28 -0
  45. kagglesdk/datasets/databundles/__init__.py +0 -0
  46. kagglesdk/datasets/databundles/types/__init__.py +0 -0
  47. kagglesdk/datasets/databundles/types/databundle_api_types.py +540 -0
  48. kagglesdk/datasets/services/dataset_api_service.py +39 -14
  49. kagglesdk/datasets/types/dataset_api_service.py +554 -300
  50. kagglesdk/datasets/types/dataset_enums.py +21 -0
  51. kagglesdk/datasets/types/dataset_service.py +145 -0
  52. kagglesdk/datasets/types/dataset_types.py +74 -74
  53. kagglesdk/datasets/types/search_datasets.py +6 -0
  54. kagglesdk/discussions/__init__.py +0 -0
  55. kagglesdk/discussions/types/__init__.py +0 -0
  56. kagglesdk/discussions/types/search_discussions.py +43 -0
  57. kagglesdk/discussions/types/writeup_enums.py +11 -0
  58. kagglesdk/education/services/education_api_service.py +1 -1
  59. kagglesdk/education/types/education_api_service.py +1 -1
  60. kagglesdk/kaggle_client.py +46 -23
  61. kagglesdk/kaggle_creds.py +148 -0
  62. kagglesdk/kaggle_env.py +89 -25
  63. kagglesdk/kaggle_http_client.py +216 -306
  64. kagglesdk/kaggle_oauth.py +200 -0
  65. kagglesdk/kaggle_object.py +286 -293
  66. kagglesdk/kernels/services/kernels_api_service.py +46 -9
  67. kagglesdk/kernels/types/kernels_api_service.py +635 -159
  68. kagglesdk/kernels/types/kernels_enums.py +6 -0
  69. kagglesdk/kernels/types/search_kernels.py +6 -0
  70. kagglesdk/licenses/__init__.py +0 -0
  71. kagglesdk/licenses/types/__init__.py +0 -0
  72. kagglesdk/licenses/types/licenses_types.py +182 -0
  73. kagglesdk/models/services/model_api_service.py +41 -17
  74. kagglesdk/models/types/model_api_service.py +987 -637
  75. kagglesdk/models/types/model_enums.py +8 -0
  76. kagglesdk/models/types/model_service.py +71 -71
  77. kagglesdk/models/types/model_types.py +1057 -5
  78. kagglesdk/models/types/search_models.py +8 -0
  79. kagglesdk/search/__init__.py +0 -0
  80. kagglesdk/search/services/__init__.py +0 -0
  81. kagglesdk/search/services/search_api_service.py +19 -0
  82. kagglesdk/search/types/__init__.py +0 -0
  83. kagglesdk/search/types/search_api_service.py +2435 -0
  84. kagglesdk/search/types/search_content_shared.py +50 -0
  85. kagglesdk/search/types/search_enums.py +45 -0
  86. kagglesdk/search/types/search_service.py +303 -0
  87. kagglesdk/security/services/iam_service.py +31 -0
  88. kagglesdk/security/services/oauth_service.py +27 -1
  89. kagglesdk/security/types/authentication.py +63 -63
  90. kagglesdk/security/types/iam_service.py +496 -0
  91. kagglesdk/security/types/oauth_service.py +797 -10
  92. kagglesdk/security/types/roles.py +8 -0
  93. kagglesdk/security/types/security_types.py +159 -0
  94. kagglesdk/test/__init__.py +0 -0
  95. kagglesdk/test/test_client.py +20 -22
  96. kagglesdk/users/services/account_service.py +13 -1
  97. kagglesdk/users/services/group_api_service.py +31 -0
  98. kagglesdk/users/types/account_service.py +169 -28
  99. kagglesdk/users/types/group_api_service.py +315 -0
  100. kagglesdk/users/types/group_types.py +165 -0
  101. kagglesdk/users/types/groups_enum.py +8 -0
  102. kagglesdk/users/types/progression_service.py +9 -0
  103. kagglesdk/users/types/search_users.py +23 -0
  104. kagglesdk/users/types/user_avatar.py +226 -0
  105. kaggle/configuration.py +0 -206
  106. kaggle-1.7.4.5.dist-info/RECORD +0 -98
  107. {kaggle-1.7.4.5.dist-info → kaggle-1.8.0.dist-info}/WHEEL +0 -0
  108. {kaggle-1.7.4.5.dist-info → kaggle-1.8.0.dist-info}/entry_points.txt +0 -0
  109. {kaggle-1.7.4.5.dist-info → kaggle-1.8.0.dist-info}/licenses/LICENSE.txt +0 -0
  110. {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
- 'id': 'int',
36
- 'slug': 'str',
37
- 'new_title': 'str',
38
- 'text': 'str',
39
- 'language': 'str',
40
- 'kernel_type': 'str',
41
- 'is_private': 'bool',
42
- 'enable_gpu': 'bool',
43
- 'enable_tpu': 'bool',
44
- 'enable_internet': 'bool',
45
- 'dataset_data_sources': 'list[str]',
46
- 'competition_data_sources': 'list[str]',
47
- 'kernel_data_sources': 'list[str]',
48
- 'model_data_sources': 'list[str]',
49
- 'category_ids': 'list[str]',
50
- 'docker_image_pinning_type': 'str'
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
- 'id': 'id',
55
- 'slug': 'slug',
56
- 'new_title': 'newTitle',
57
- 'text': 'text',
58
- 'language': 'language',
59
- 'kernel_type': 'kernelType',
60
- 'is_private': 'isPrivate',
61
- 'enable_gpu': 'enableGpu',
62
- 'enable_tpu': 'enableTpu',
63
- 'enable_internet': 'enableInternet',
64
- 'dataset_data_sources': 'datasetDataSources',
65
- 'competition_data_sources': 'competitionDataSources',
66
- 'kernel_data_sources': 'kernelDataSources',
67
- 'model_data_sources': 'modelDataSources',
68
- 'category_ids': 'categoryIds',
69
- 'docker_image_pinning_type': 'dockerImagePinningType'
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__(self, id=None, slug=None, new_title=None, text=None, language=None, kernel_type=None, is_private=None, enable_gpu=None, enable_tpu=None, enable_internet=None, dataset_data_sources=None, competition_data_sources=None, kernel_data_sources=None, model_data_sources=None, category_ids=None, docker_image_pinning_type=None): # noqa: E501
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
- .format(kernel_type, allowed_values)
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
- .format(docker_image_pinning_type, allowed_values)
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(map(
564
- lambda item: (item[0], item[1].to_dict())
565
- if hasattr(item[1], "to_dict") else item,
566
- value.items()
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
- attribute_map = {
41
- 'version_notes': 'versionNotes',
42
- 'files': 'files'
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(map(
126
- lambda item: (item[0], item[1].to_dict())
127
- if hasattr(item[1], "to_dict") else item,
128
- value.items()
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
- 'overview': 'str',
35
- 'usage': 'str',
36
- 'license_name': 'str',
37
- 'fine_tunable': 'bool',
38
- 'training_data': 'list[str]',
39
- 'model_instance_type': 'str',
40
- 'base_model_instance': 'str',
41
- 'external_base_model_url': 'int',
42
- 'update_mask': 'str'
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
- 'overview': 'overview',
47
- 'usage': 'usage',
48
- 'license_name': 'licenseName',
49
- 'fine_tunable': 'fineTunable',
50
- 'training_data': 'trainingData',
51
- 'model_instance_type': 'modelInstanceType',
52
- 'base_model_instance': 'baseModelInstance',
53
- 'external_base_model_url': 'externalBaseModelUrl',
54
- 'update_mask': 'updateMask'
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__(self, overview=None, usage=None, license_name='Apache 2.0', fine_tunable=True, training_data=None, model_instance_type=None, base_model_instance=None, external_base_model_url=None, update_mask=None): # noqa: E501
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 = ["CC0 1.0", "CC BY-NC-SA 4.0", "Unknown", "CC BY-SA 4.0", "GPL 2", "CC BY-SA 3.0", "Other", "Other (specified in description)", "CC BY 4.0", "Attribution 4.0 International (CC BY 4.0)", "CC BY-NC 4.0", "Attribution-NonCommercial 4.0 International (CC BY-NC 4.0)", "PDDL", "ODC Public Domain Dedication and Licence (PDDL)", "CC BY 3.0", "Attribution 3.0 Unported (CC BY 3.0)", "CC BY 3.0 IGO", "Attribution 3.0 IGO (CC BY 3.0 IGO)", "CC BY-NC-SA 3.0 IGO", "Attribution-NonCommercial-ShareAlike 3.0 IGO (CC BY-NC-SA 3.0 IGO)", "CDLA Permissive 1.0", "Community Data License Agreement - Permissive - Version 1.0", "CDLA Sharing 1.0", "Community Data License Agreement - Sharing - Version 1.0", "CC BY-ND 4.0", "Attribution-NoDerivatives 4.0 International (CC BY-ND 4.0)", "CC BY-NC-ND 4.0", "Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0)", "ODC-BY 1.0", "ODC Attribution License (ODC-By)", "LGPL 3.0", "GNU Lesser General Public License 3.0", "AGPL 3.0", "GNU Affero General Public License 3.0", "FDL 1.3", "GNU Free Documentation License 1.3", "apache-2.0", "Apache 2.0", "mit", "MIT", "bsd-3-clause", "BSD-3-Clause", "Llama 2", "Llama 2 Community License", "Gemma", "gpl-3", "GPL 3", "RAIL-M", "AI Pubs Open RAIL-M License", "AIPubs Research-Use RAIL-M", "AI Pubs Research-Use RAIL-M License", "BigScience OpenRAIL-M", "BigScience Open RAIL-M License", "RAIL", "RAIL (specified in description)", "Llama 3", "Llama 3 Community License"] # noqa: E501
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
- .format(license_name, allowed_values)
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
- .format(model_instance_type, allowed_values)
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(map(
355
- lambda item: (item[0], item[1].to_dict())
356
- if hasattr(item[1], "to_dict") else item,
357
- value.items()
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
- 'instance_slug': 'str',
37
- 'framework': 'str',
38
- 'overview': 'str',
39
- 'usage': 'str',
40
- 'license_name': 'str',
41
- 'fine_tunable': 'bool',
42
- 'training_data': 'list[str]',
43
- 'model_instance_type': 'str',
44
- 'base_model_instance': 'str',
45
- 'external_base_model_url': 'int',
46
- 'files': 'list[UploadFile]'
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
- 'instance_slug': 'instanceSlug',
51
- 'framework': 'framework',
52
- 'overview': 'overview',
53
- 'usage': 'usage',
54
- 'license_name': 'licenseName',
55
- 'fine_tunable': 'fineTunable',
56
- 'training_data': 'trainingData',
57
- 'model_instance_type': 'modelInstanceType',
58
- 'base_model_instance': 'baseModelInstance',
59
- 'external_base_model_url': 'externalBaseModelUrl',
60
- 'files': 'files'
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__(self, instance_slug=None, framework=None, overview=None, usage=None, license_name='Apache 2.0', fine_tunable=True, training_data=None, model_instance_type=None, base_model_instance=None, external_base_model_url=None, files=None): # noqa: E501
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 = ["tensorFlow1", "tensorFlow2", "tfLite", "tfJs", "pyTorch", "jax", "flax", "pax", "maxText", "gemmaCpp", "tensorRtLlm", "ggml", "gguf", "coral", "scikitLearn", "mxnet", "onnx", "keras", "transformers", "triton", "api", "triton", "tensorRtLlm","other"] # noqa: E501
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
- .format(framework, allowed_values)
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 = ["CC0 1.0", "CC BY-NC-SA 4.0", "Unknown", "CC BY-SA 4.0", "GPL 2", "CC BY-SA 3.0", "Other", "Other (specified in description)", "CC BY 4.0", "Attribution 4.0 International (CC BY 4.0)", "CC BY-NC 4.0", "Attribution-NonCommercial 4.0 International (CC BY-NC 4.0)", "PDDL", "ODC Public Domain Dedication and Licence (PDDL)", "CC BY 3.0", "Attribution 3.0 Unported (CC BY 3.0)", "CC BY 3.0 IGO", "Attribution 3.0 IGO (CC BY 3.0 IGO)", "CC BY-NC-SA 3.0 IGO", "Attribution-NonCommercial-ShareAlike 3.0 IGO (CC BY-NC-SA 3.0 IGO)", "CDLA Permissive 1.0", "Community Data License Agreement - Permissive - Version 1.0", "CDLA Sharing 1.0", "Community Data License Agreement - Sharing - Version 1.0", "CC BY-ND 4.0", "Attribution-NoDerivatives 4.0 International (CC BY-ND 4.0)", "CC BY-NC-ND 4.0", "Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0)", "ODC-BY 1.0", "ODC Attribution License (ODC-By)", "LGPL 3.0", "GNU Lesser General Public License 3.0", "AGPL 3.0", "GNU Affero General Public License 3.0", "FDL 1.3", "GNU Free Documentation License 1.3", "apache-2.0", "Apache 2.0", "mit", "MIT", "bsd-3-clause", "BSD-3-Clause", "Llama 2", "Llama 2 Community License", "Gemma", "gpl-3", "GPL 3", "RAIL-M", "AI Pubs Open RAIL-M License", "AIPubs Research-Use RAIL-M", "AI Pubs Research-Use RAIL-M License", "BigScience OpenRAIL-M", "BigScience Open RAIL-M License", "RAIL", "RAIL (specified in description)", "Llama 3", "Llama 3 Community License"] # noqa: E501
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
- .format(license_name, allowed_values)
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
- .format(model_instance_type, allowed_values)
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(map(
428
- lambda item: (item[0], item[1].to_dict())
429
- if hasattr(item[1], "to_dict") else item,
430
- value.items()
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
-