truefoundry 0.4.10__py3-none-any.whl → 0.5.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.
Potentially problematic release.
This version of truefoundry might be problematic. Click here for more details.
- truefoundry/deploy/builder/builders/tfy_python_buildpack/dockerfile_template.py +2 -2
- truefoundry/deploy/lib/dao/application.py +2 -1
- truefoundry/ml/__init__.py +41 -1
- truefoundry/ml/autogen/client/__init__.py +44 -14
- truefoundry/ml/autogen/client/api/__init__.py +3 -3
- truefoundry/ml/autogen/client/api/deprecated_api.py +333 -0
- truefoundry/ml/autogen/client/api/generate_code_snippet_api.py +526 -0
- truefoundry/ml/autogen/client/api/mlfoundry_artifacts_api.py +0 -322
- truefoundry/ml/autogen/client/api_client.py +8 -1
- truefoundry/ml/autogen/client/models/__init__.py +41 -11
- truefoundry/ml/autogen/client/models/add_features_to_model_version_request_dto.py +3 -17
- truefoundry/ml/autogen/client/models/agent.py +1 -1
- truefoundry/ml/autogen/client/models/agent_app.py +1 -1
- truefoundry/ml/autogen/client/models/agent_open_api_tool.py +1 -1
- truefoundry/ml/autogen/client/models/agent_open_api_tool_with_fqn.py +1 -1
- truefoundry/ml/autogen/client/models/agent_with_fqn.py +1 -1
- truefoundry/ml/autogen/client/models/artifact_version_dto.py +3 -5
- truefoundry/ml/autogen/client/models/artifact_version_manifest.py +111 -0
- truefoundry/ml/autogen/client/models/assistant_message.py +1 -1
- truefoundry/ml/autogen/client/models/blob_storage_reference.py +1 -1
- truefoundry/ml/autogen/client/models/chat_prompt.py +1 -1
- truefoundry/ml/autogen/client/models/command.py +152 -0
- truefoundry/ml/autogen/client/models/{feature_dto.py → create_workflow_task_config_request_dto.py} +18 -14
- truefoundry/ml/autogen/client/models/{external_model_source.py → external_artifact_source.py} +12 -11
- truefoundry/ml/autogen/client/models/fast_ai_framework.py +75 -0
- truefoundry/ml/autogen/client/models/finalize_artifact_version_request_dto.py +3 -5
- truefoundry/ml/autogen/client/models/framework.py +250 -14
- truefoundry/ml/autogen/client/models/gluon_framework.py +74 -0
- truefoundry/ml/autogen/client/models/{upload_model_source.py → h2_o_framework.py} +11 -11
- truefoundry/ml/autogen/client/models/image_content_part.py +1 -1
- truefoundry/ml/autogen/client/models/keras_framework.py +74 -0
- truefoundry/ml/autogen/client/models/light_gbm_framework.py +75 -0
- truefoundry/ml/autogen/client/models/manifest.py +154 -0
- truefoundry/ml/autogen/client/models/model_version_dto.py +7 -8
- truefoundry/ml/autogen/client/models/model_version_environment.py +97 -0
- truefoundry/ml/autogen/client/models/model_version_manifest.py +30 -6
- truefoundry/ml/autogen/client/models/onnx_framework.py +74 -0
- truefoundry/ml/autogen/client/models/paddle_framework.py +75 -0
- truefoundry/ml/autogen/client/models/py_torch_framework.py +75 -0
- truefoundry/ml/autogen/client/models/{feature_value_type.py → serialization_format.py} +8 -8
- truefoundry/ml/autogen/client/models/sklearn_framework.py +92 -0
- truefoundry/ml/autogen/client/models/source.py +23 -46
- truefoundry/ml/autogen/client/models/source1.py +154 -0
- truefoundry/ml/autogen/client/models/spa_cy_framework.py +74 -0
- truefoundry/ml/autogen/client/models/stats_models_framework.py +75 -0
- truefoundry/ml/autogen/client/models/system_message.py +1 -1
- truefoundry/ml/autogen/client/models/{tensorflow_framework.py → tensor_flow_framework.py} +11 -10
- truefoundry/ml/autogen/client/models/text_content_part.py +1 -1
- truefoundry/ml/autogen/client/models/transformers_framework.py +10 -4
- truefoundry/ml/autogen/client/models/trigger_job_run_config_request_dto.py +90 -0
- truefoundry/ml/autogen/client/models/trigger_job_run_config_response_dto.py +71 -0
- truefoundry/ml/autogen/client/models/{truefoundry_model_source.py → true_foundry_artifact_source.py} +13 -11
- truefoundry/ml/autogen/client/models/update_artifact_version_request_dto.py +11 -1
- truefoundry/ml/autogen/client/models/update_model_version_request_dto.py +1 -13
- truefoundry/ml/autogen/client/models/user_message.py +1 -1
- truefoundry/ml/autogen/client/models/xg_boost_framework.py +92 -0
- truefoundry/ml/autogen/client_README.md +30 -12
- truefoundry/ml/autogen/entities/artifacts.py +87 -9
- truefoundry/ml/autogen/models/__init__.py +4 -0
- truefoundry/ml/autogen/models/exceptions.py +30 -0
- truefoundry/ml/autogen/models/schema.py +1547 -0
- truefoundry/ml/autogen/models/signature.py +139 -0
- truefoundry/ml/autogen/models/utils.py +699 -0
- truefoundry/ml/log_types/artifacts/artifact.py +131 -63
- truefoundry/ml/log_types/artifacts/general_artifact.py +7 -26
- truefoundry/ml/log_types/artifacts/model.py +195 -197
- truefoundry/ml/mlfoundry_api.py +47 -52
- truefoundry/ml/mlfoundry_run.py +35 -43
- truefoundry/ml/model_framework.py +169 -0
- {truefoundry-0.4.10.dist-info → truefoundry-0.5.0.dist-info}/METADATA +1 -1
- {truefoundry-0.4.10.dist-info → truefoundry-0.5.0.dist-info}/RECORD +73 -51
- truefoundry/ml/autogen/client/api/python_deployment_config_api.py +0 -201
- truefoundry/ml/autogen/client/models/model_schema_dto.py +0 -85
- truefoundry/ml/autogen/client/models/prediction_type.py +0 -34
- {truefoundry-0.4.10.dist-info → truefoundry-0.5.0.dist-info}/WHEEL +0 -0
- {truefoundry-0.4.10.dist-info → truefoundry-0.5.0.dist-info}/entry_points.txt +0 -0
|
@@ -18,12 +18,26 @@ import pprint
|
|
|
18
18
|
import re # noqa: F401
|
|
19
19
|
from typing import TYPE_CHECKING, Any, List, Optional, Union
|
|
20
20
|
|
|
21
|
-
from truefoundry.ml.autogen.client.models.
|
|
22
|
-
|
|
21
|
+
from truefoundry.ml.autogen.client.models.fast_ai_framework import FastAIFramework
|
|
22
|
+
from truefoundry.ml.autogen.client.models.gluon_framework import GluonFramework
|
|
23
|
+
from truefoundry.ml.autogen.client.models.h2_o_framework import H2OFramework
|
|
24
|
+
from truefoundry.ml.autogen.client.models.keras_framework import KerasFramework
|
|
25
|
+
from truefoundry.ml.autogen.client.models.light_gbm_framework import LightGBMFramework
|
|
26
|
+
from truefoundry.ml.autogen.client.models.onnx_framework import ONNXFramework
|
|
27
|
+
from truefoundry.ml.autogen.client.models.paddle_framework import PaddleFramework
|
|
28
|
+
from truefoundry.ml.autogen.client.models.py_torch_framework import PyTorchFramework
|
|
29
|
+
from truefoundry.ml.autogen.client.models.sklearn_framework import SklearnFramework
|
|
30
|
+
from truefoundry.ml.autogen.client.models.spa_cy_framework import SpaCyFramework
|
|
31
|
+
from truefoundry.ml.autogen.client.models.stats_models_framework import (
|
|
32
|
+
StatsModelsFramework,
|
|
33
|
+
)
|
|
34
|
+
from truefoundry.ml.autogen.client.models.tensor_flow_framework import (
|
|
35
|
+
TensorFlowFramework,
|
|
23
36
|
)
|
|
24
37
|
from truefoundry.ml.autogen.client.models.transformers_framework import (
|
|
25
38
|
TransformersFramework,
|
|
26
39
|
)
|
|
40
|
+
from truefoundry.ml.autogen.client.models.xg_boost_framework import XGBoostFramework
|
|
27
41
|
from truefoundry.pydantic_v1 import (
|
|
28
42
|
BaseModel,
|
|
29
43
|
Field,
|
|
@@ -31,20 +45,74 @@ from truefoundry.pydantic_v1 import (
|
|
|
31
45
|
validator,
|
|
32
46
|
)
|
|
33
47
|
|
|
34
|
-
FRAMEWORK_ANY_OF_SCHEMAS = [
|
|
48
|
+
FRAMEWORK_ANY_OF_SCHEMAS = [
|
|
49
|
+
"FastAIFramework",
|
|
50
|
+
"GluonFramework",
|
|
51
|
+
"H2OFramework",
|
|
52
|
+
"KerasFramework",
|
|
53
|
+
"LightGBMFramework",
|
|
54
|
+
"ONNXFramework",
|
|
55
|
+
"PaddleFramework",
|
|
56
|
+
"PyTorchFramework",
|
|
57
|
+
"SklearnFramework",
|
|
58
|
+
"SpaCyFramework",
|
|
59
|
+
"StatsModelsFramework",
|
|
60
|
+
"TensorFlowFramework",
|
|
61
|
+
"TransformersFramework",
|
|
62
|
+
"XGBoostFramework",
|
|
63
|
+
]
|
|
35
64
|
|
|
36
65
|
|
|
37
66
|
class Framework(BaseModel):
|
|
38
67
|
"""
|
|
39
|
-
+label=Framework +usage=Framework for the model version
|
|
68
|
+
+label=Framework +usage=Framework for the model version
|
|
40
69
|
"""
|
|
41
70
|
|
|
42
71
|
# data type: TransformersFramework
|
|
43
72
|
anyof_schema_1_validator: Optional[TransformersFramework] = None
|
|
44
|
-
# data type:
|
|
45
|
-
anyof_schema_2_validator: Optional[
|
|
73
|
+
# data type: TensorFlowFramework
|
|
74
|
+
anyof_schema_2_validator: Optional[TensorFlowFramework] = None
|
|
75
|
+
# data type: SklearnFramework
|
|
76
|
+
anyof_schema_3_validator: Optional[SklearnFramework] = None
|
|
77
|
+
# data type: PyTorchFramework
|
|
78
|
+
anyof_schema_4_validator: Optional[PyTorchFramework] = None
|
|
79
|
+
# data type: KerasFramework
|
|
80
|
+
anyof_schema_5_validator: Optional[KerasFramework] = None
|
|
81
|
+
# data type: XGBoostFramework
|
|
82
|
+
anyof_schema_6_validator: Optional[XGBoostFramework] = None
|
|
83
|
+
# data type: LightGBMFramework
|
|
84
|
+
anyof_schema_7_validator: Optional[LightGBMFramework] = None
|
|
85
|
+
# data type: FastAIFramework
|
|
86
|
+
anyof_schema_8_validator: Optional[FastAIFramework] = None
|
|
87
|
+
# data type: H2OFramework
|
|
88
|
+
anyof_schema_9_validator: Optional[H2OFramework] = None
|
|
89
|
+
# data type: ONNXFramework
|
|
90
|
+
anyof_schema_10_validator: Optional[ONNXFramework] = None
|
|
91
|
+
# data type: SpaCyFramework
|
|
92
|
+
anyof_schema_11_validator: Optional[SpaCyFramework] = None
|
|
93
|
+
# data type: StatsModelsFramework
|
|
94
|
+
anyof_schema_12_validator: Optional[StatsModelsFramework] = None
|
|
95
|
+
# data type: GluonFramework
|
|
96
|
+
anyof_schema_13_validator: Optional[GluonFramework] = None
|
|
97
|
+
# data type: PaddleFramework
|
|
98
|
+
anyof_schema_14_validator: Optional[PaddleFramework] = None
|
|
46
99
|
if TYPE_CHECKING:
|
|
47
|
-
actual_instance: Union[
|
|
100
|
+
actual_instance: Union[
|
|
101
|
+
FastAIFramework,
|
|
102
|
+
GluonFramework,
|
|
103
|
+
H2OFramework,
|
|
104
|
+
KerasFramework,
|
|
105
|
+
LightGBMFramework,
|
|
106
|
+
ONNXFramework,
|
|
107
|
+
PaddleFramework,
|
|
108
|
+
PyTorchFramework,
|
|
109
|
+
SklearnFramework,
|
|
110
|
+
SpaCyFramework,
|
|
111
|
+
StatsModelsFramework,
|
|
112
|
+
TensorFlowFramework,
|
|
113
|
+
TransformersFramework,
|
|
114
|
+
XGBoostFramework,
|
|
115
|
+
]
|
|
48
116
|
else:
|
|
49
117
|
actual_instance: Any
|
|
50
118
|
any_of_schemas: List[str] = Field(FRAMEWORK_ANY_OF_SCHEMAS, const=True)
|
|
@@ -78,10 +146,106 @@ class Framework(BaseModel):
|
|
|
78
146
|
else:
|
|
79
147
|
return v
|
|
80
148
|
|
|
81
|
-
# validate data type:
|
|
82
|
-
if not isinstance(v,
|
|
149
|
+
# validate data type: TensorFlowFramework
|
|
150
|
+
if not isinstance(v, TensorFlowFramework):
|
|
151
|
+
error_messages.append(
|
|
152
|
+
f"Error! Input type `{type(v)}` is not `TensorFlowFramework`"
|
|
153
|
+
)
|
|
154
|
+
else:
|
|
155
|
+
return v
|
|
156
|
+
|
|
157
|
+
# validate data type: SklearnFramework
|
|
158
|
+
if not isinstance(v, SklearnFramework):
|
|
159
|
+
error_messages.append(
|
|
160
|
+
f"Error! Input type `{type(v)}` is not `SklearnFramework`"
|
|
161
|
+
)
|
|
162
|
+
else:
|
|
163
|
+
return v
|
|
164
|
+
|
|
165
|
+
# validate data type: PyTorchFramework
|
|
166
|
+
if not isinstance(v, PyTorchFramework):
|
|
167
|
+
error_messages.append(
|
|
168
|
+
f"Error! Input type `{type(v)}` is not `PyTorchFramework`"
|
|
169
|
+
)
|
|
170
|
+
else:
|
|
171
|
+
return v
|
|
172
|
+
|
|
173
|
+
# validate data type: KerasFramework
|
|
174
|
+
if not isinstance(v, KerasFramework):
|
|
175
|
+
error_messages.append(
|
|
176
|
+
f"Error! Input type `{type(v)}` is not `KerasFramework`"
|
|
177
|
+
)
|
|
178
|
+
else:
|
|
179
|
+
return v
|
|
180
|
+
|
|
181
|
+
# validate data type: XGBoostFramework
|
|
182
|
+
if not isinstance(v, XGBoostFramework):
|
|
83
183
|
error_messages.append(
|
|
84
|
-
f"Error! Input type `{type(v)}` is not `
|
|
184
|
+
f"Error! Input type `{type(v)}` is not `XGBoostFramework`"
|
|
185
|
+
)
|
|
186
|
+
else:
|
|
187
|
+
return v
|
|
188
|
+
|
|
189
|
+
# validate data type: LightGBMFramework
|
|
190
|
+
if not isinstance(v, LightGBMFramework):
|
|
191
|
+
error_messages.append(
|
|
192
|
+
f"Error! Input type `{type(v)}` is not `LightGBMFramework`"
|
|
193
|
+
)
|
|
194
|
+
else:
|
|
195
|
+
return v
|
|
196
|
+
|
|
197
|
+
# validate data type: FastAIFramework
|
|
198
|
+
if not isinstance(v, FastAIFramework):
|
|
199
|
+
error_messages.append(
|
|
200
|
+
f"Error! Input type `{type(v)}` is not `FastAIFramework`"
|
|
201
|
+
)
|
|
202
|
+
else:
|
|
203
|
+
return v
|
|
204
|
+
|
|
205
|
+
# validate data type: H2OFramework
|
|
206
|
+
if not isinstance(v, H2OFramework):
|
|
207
|
+
error_messages.append(
|
|
208
|
+
f"Error! Input type `{type(v)}` is not `H2OFramework`"
|
|
209
|
+
)
|
|
210
|
+
else:
|
|
211
|
+
return v
|
|
212
|
+
|
|
213
|
+
# validate data type: ONNXFramework
|
|
214
|
+
if not isinstance(v, ONNXFramework):
|
|
215
|
+
error_messages.append(
|
|
216
|
+
f"Error! Input type `{type(v)}` is not `ONNXFramework`"
|
|
217
|
+
)
|
|
218
|
+
else:
|
|
219
|
+
return v
|
|
220
|
+
|
|
221
|
+
# validate data type: SpaCyFramework
|
|
222
|
+
if not isinstance(v, SpaCyFramework):
|
|
223
|
+
error_messages.append(
|
|
224
|
+
f"Error! Input type `{type(v)}` is not `SpaCyFramework`"
|
|
225
|
+
)
|
|
226
|
+
else:
|
|
227
|
+
return v
|
|
228
|
+
|
|
229
|
+
# validate data type: StatsModelsFramework
|
|
230
|
+
if not isinstance(v, StatsModelsFramework):
|
|
231
|
+
error_messages.append(
|
|
232
|
+
f"Error! Input type `{type(v)}` is not `StatsModelsFramework`"
|
|
233
|
+
)
|
|
234
|
+
else:
|
|
235
|
+
return v
|
|
236
|
+
|
|
237
|
+
# validate data type: GluonFramework
|
|
238
|
+
if not isinstance(v, GluonFramework):
|
|
239
|
+
error_messages.append(
|
|
240
|
+
f"Error! Input type `{type(v)}` is not `GluonFramework`"
|
|
241
|
+
)
|
|
242
|
+
else:
|
|
243
|
+
return v
|
|
244
|
+
|
|
245
|
+
# validate data type: PaddleFramework
|
|
246
|
+
if not isinstance(v, PaddleFramework):
|
|
247
|
+
error_messages.append(
|
|
248
|
+
f"Error! Input type `{type(v)}` is not `PaddleFramework`"
|
|
85
249
|
)
|
|
86
250
|
else:
|
|
87
251
|
return v
|
|
@@ -89,7 +253,7 @@ class Framework(BaseModel):
|
|
|
89
253
|
if error_messages:
|
|
90
254
|
# no match
|
|
91
255
|
raise ValueError(
|
|
92
|
-
"No match found when setting the actual_instance in Framework with anyOf schemas:
|
|
256
|
+
"No match found when setting the actual_instance in Framework with anyOf schemas: FastAIFramework, GluonFramework, H2OFramework, KerasFramework, LightGBMFramework, ONNXFramework, PaddleFramework, PyTorchFramework, SklearnFramework, SpaCyFramework, StatsModelsFramework, TensorFlowFramework, TransformersFramework, XGBoostFramework. Details: "
|
|
93
257
|
+ ", ".join(error_messages)
|
|
94
258
|
)
|
|
95
259
|
else:
|
|
@@ -110,9 +274,81 @@ class Framework(BaseModel):
|
|
|
110
274
|
return instance
|
|
111
275
|
except (ValidationError, ValueError) as e:
|
|
112
276
|
error_messages.append(str(e))
|
|
113
|
-
# anyof_schema_2_validator: Optional[
|
|
277
|
+
# anyof_schema_2_validator: Optional[TensorFlowFramework] = None
|
|
278
|
+
try:
|
|
279
|
+
instance.actual_instance = TensorFlowFramework.from_json(json_str)
|
|
280
|
+
return instance
|
|
281
|
+
except (ValidationError, ValueError) as e:
|
|
282
|
+
error_messages.append(str(e))
|
|
283
|
+
# anyof_schema_3_validator: Optional[SklearnFramework] = None
|
|
284
|
+
try:
|
|
285
|
+
instance.actual_instance = SklearnFramework.from_json(json_str)
|
|
286
|
+
return instance
|
|
287
|
+
except (ValidationError, ValueError) as e:
|
|
288
|
+
error_messages.append(str(e))
|
|
289
|
+
# anyof_schema_4_validator: Optional[PyTorchFramework] = None
|
|
290
|
+
try:
|
|
291
|
+
instance.actual_instance = PyTorchFramework.from_json(json_str)
|
|
292
|
+
return instance
|
|
293
|
+
except (ValidationError, ValueError) as e:
|
|
294
|
+
error_messages.append(str(e))
|
|
295
|
+
# anyof_schema_5_validator: Optional[KerasFramework] = None
|
|
296
|
+
try:
|
|
297
|
+
instance.actual_instance = KerasFramework.from_json(json_str)
|
|
298
|
+
return instance
|
|
299
|
+
except (ValidationError, ValueError) as e:
|
|
300
|
+
error_messages.append(str(e))
|
|
301
|
+
# anyof_schema_6_validator: Optional[XGBoostFramework] = None
|
|
302
|
+
try:
|
|
303
|
+
instance.actual_instance = XGBoostFramework.from_json(json_str)
|
|
304
|
+
return instance
|
|
305
|
+
except (ValidationError, ValueError) as e:
|
|
306
|
+
error_messages.append(str(e))
|
|
307
|
+
# anyof_schema_7_validator: Optional[LightGBMFramework] = None
|
|
308
|
+
try:
|
|
309
|
+
instance.actual_instance = LightGBMFramework.from_json(json_str)
|
|
310
|
+
return instance
|
|
311
|
+
except (ValidationError, ValueError) as e:
|
|
312
|
+
error_messages.append(str(e))
|
|
313
|
+
# anyof_schema_8_validator: Optional[FastAIFramework] = None
|
|
314
|
+
try:
|
|
315
|
+
instance.actual_instance = FastAIFramework.from_json(json_str)
|
|
316
|
+
return instance
|
|
317
|
+
except (ValidationError, ValueError) as e:
|
|
318
|
+
error_messages.append(str(e))
|
|
319
|
+
# anyof_schema_9_validator: Optional[H2OFramework] = None
|
|
320
|
+
try:
|
|
321
|
+
instance.actual_instance = H2OFramework.from_json(json_str)
|
|
322
|
+
return instance
|
|
323
|
+
except (ValidationError, ValueError) as e:
|
|
324
|
+
error_messages.append(str(e))
|
|
325
|
+
# anyof_schema_10_validator: Optional[ONNXFramework] = None
|
|
326
|
+
try:
|
|
327
|
+
instance.actual_instance = ONNXFramework.from_json(json_str)
|
|
328
|
+
return instance
|
|
329
|
+
except (ValidationError, ValueError) as e:
|
|
330
|
+
error_messages.append(str(e))
|
|
331
|
+
# anyof_schema_11_validator: Optional[SpaCyFramework] = None
|
|
332
|
+
try:
|
|
333
|
+
instance.actual_instance = SpaCyFramework.from_json(json_str)
|
|
334
|
+
return instance
|
|
335
|
+
except (ValidationError, ValueError) as e:
|
|
336
|
+
error_messages.append(str(e))
|
|
337
|
+
# anyof_schema_12_validator: Optional[StatsModelsFramework] = None
|
|
338
|
+
try:
|
|
339
|
+
instance.actual_instance = StatsModelsFramework.from_json(json_str)
|
|
340
|
+
return instance
|
|
341
|
+
except (ValidationError, ValueError) as e:
|
|
342
|
+
error_messages.append(str(e))
|
|
343
|
+
# anyof_schema_13_validator: Optional[GluonFramework] = None
|
|
344
|
+
try:
|
|
345
|
+
instance.actual_instance = GluonFramework.from_json(json_str)
|
|
346
|
+
return instance
|
|
347
|
+
except (ValidationError, ValueError) as e:
|
|
348
|
+
error_messages.append(str(e))
|
|
349
|
+
# anyof_schema_14_validator: Optional[PaddleFramework] = None
|
|
114
350
|
try:
|
|
115
|
-
instance.actual_instance =
|
|
351
|
+
instance.actual_instance = PaddleFramework.from_json(json_str)
|
|
116
352
|
return instance
|
|
117
353
|
except (ValidationError, ValueError) as e:
|
|
118
354
|
error_messages.append(str(e))
|
|
@@ -120,7 +356,7 @@ class Framework(BaseModel):
|
|
|
120
356
|
if error_messages:
|
|
121
357
|
# no match
|
|
122
358
|
raise ValueError(
|
|
123
|
-
"No match found when deserializing the JSON string into Framework with anyOf schemas:
|
|
359
|
+
"No match found when deserializing the JSON string into Framework with anyOf schemas: FastAIFramework, GluonFramework, H2OFramework, KerasFramework, LightGBMFramework, ONNXFramework, PaddleFramework, PyTorchFramework, SklearnFramework, SpaCyFramework, StatsModelsFramework, TensorFlowFramework, TransformersFramework, XGBoostFramework. Details: "
|
|
124
360
|
+ ", ".join(error_messages)
|
|
125
361
|
)
|
|
126
362
|
else:
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
FastAPI
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 0.1.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
from __future__ import annotations
|
|
15
|
+
|
|
16
|
+
import json
|
|
17
|
+
import pprint
|
|
18
|
+
import re # noqa: F401
|
|
19
|
+
|
|
20
|
+
from truefoundry.pydantic_v1 import BaseModel, Field, StrictStr, validator
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class GluonFramework(BaseModel):
|
|
24
|
+
"""
|
|
25
|
+
+docs=Gluon framework for the model version +label=Gluon # noqa: E501
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
type: StrictStr = Field(
|
|
29
|
+
default=..., description="+label=Type +usage=Type of the framework +value=gluon"
|
|
30
|
+
)
|
|
31
|
+
__properties = ["type"]
|
|
32
|
+
|
|
33
|
+
@validator("type")
|
|
34
|
+
def type_validate_enum(cls, value):
|
|
35
|
+
"""Validates the enum"""
|
|
36
|
+
if value not in ("gluon",):
|
|
37
|
+
raise ValueError("must be one of enum values ('gluon')")
|
|
38
|
+
return value
|
|
39
|
+
|
|
40
|
+
class Config:
|
|
41
|
+
"""Pydantic configuration"""
|
|
42
|
+
|
|
43
|
+
allow_population_by_field_name = True
|
|
44
|
+
validate_assignment = True
|
|
45
|
+
|
|
46
|
+
def to_str(self) -> str:
|
|
47
|
+
"""Returns the string representation of the model using alias"""
|
|
48
|
+
return pprint.pformat(self.dict(by_alias=True))
|
|
49
|
+
|
|
50
|
+
def to_json(self) -> str:
|
|
51
|
+
"""Returns the JSON representation of the model using alias"""
|
|
52
|
+
return json.dumps(self.to_dict())
|
|
53
|
+
|
|
54
|
+
@classmethod
|
|
55
|
+
def from_json(cls, json_str: str) -> GluonFramework:
|
|
56
|
+
"""Create an instance of GluonFramework from a JSON string"""
|
|
57
|
+
return cls.from_dict(json.loads(json_str))
|
|
58
|
+
|
|
59
|
+
def to_dict(self):
|
|
60
|
+
"""Returns the dictionary representation of the model using alias"""
|
|
61
|
+
_dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
|
|
62
|
+
return _dict
|
|
63
|
+
|
|
64
|
+
@classmethod
|
|
65
|
+
def from_dict(cls, obj: dict) -> GluonFramework:
|
|
66
|
+
"""Create an instance of GluonFramework from a dict"""
|
|
67
|
+
if obj is None:
|
|
68
|
+
return None
|
|
69
|
+
|
|
70
|
+
if not isinstance(obj, dict):
|
|
71
|
+
return GluonFramework.parse_obj(obj)
|
|
72
|
+
|
|
73
|
+
_obj = GluonFramework.parse_obj({"type": obj.get("type")})
|
|
74
|
+
return _obj
|
|
@@ -20,21 +20,21 @@ import re # noqa: F401
|
|
|
20
20
|
from truefoundry.pydantic_v1 import BaseModel, Field, StrictStr, validator
|
|
21
21
|
|
|
22
22
|
|
|
23
|
-
class
|
|
23
|
+
class H2OFramework(BaseModel):
|
|
24
24
|
"""
|
|
25
|
-
|
|
25
|
+
+docs=H2O framework for the model version +label=H2O # noqa: E501
|
|
26
26
|
"""
|
|
27
27
|
|
|
28
28
|
type: StrictStr = Field(
|
|
29
|
-
default=..., description="+label=Type +usage=Type of the
|
|
29
|
+
default=..., description="+label=Type +usage=Type of the framework +value=h2o"
|
|
30
30
|
)
|
|
31
31
|
__properties = ["type"]
|
|
32
32
|
|
|
33
33
|
@validator("type")
|
|
34
34
|
def type_validate_enum(cls, value):
|
|
35
35
|
"""Validates the enum"""
|
|
36
|
-
if value not in ("
|
|
37
|
-
raise ValueError("must be one of enum values ('
|
|
36
|
+
if value not in ("h2o",):
|
|
37
|
+
raise ValueError("must be one of enum values ('h2o')")
|
|
38
38
|
return value
|
|
39
39
|
|
|
40
40
|
class Config:
|
|
@@ -52,8 +52,8 @@ class UploadModelSource(BaseModel):
|
|
|
52
52
|
return json.dumps(self.to_dict())
|
|
53
53
|
|
|
54
54
|
@classmethod
|
|
55
|
-
def from_json(cls, json_str: str) ->
|
|
56
|
-
"""Create an instance of
|
|
55
|
+
def from_json(cls, json_str: str) -> H2OFramework:
|
|
56
|
+
"""Create an instance of H2OFramework from a JSON string"""
|
|
57
57
|
return cls.from_dict(json.loads(json_str))
|
|
58
58
|
|
|
59
59
|
def to_dict(self):
|
|
@@ -62,13 +62,13 @@ class UploadModelSource(BaseModel):
|
|
|
62
62
|
return _dict
|
|
63
63
|
|
|
64
64
|
@classmethod
|
|
65
|
-
def from_dict(cls, obj: dict) ->
|
|
66
|
-
"""Create an instance of
|
|
65
|
+
def from_dict(cls, obj: dict) -> H2OFramework:
|
|
66
|
+
"""Create an instance of H2OFramework from a dict"""
|
|
67
67
|
if obj is None:
|
|
68
68
|
return None
|
|
69
69
|
|
|
70
70
|
if not isinstance(obj, dict):
|
|
71
|
-
return
|
|
71
|
+
return H2OFramework.parse_obj(obj)
|
|
72
72
|
|
|
73
|
-
_obj =
|
|
73
|
+
_obj = H2OFramework.parse_obj({"type": obj.get("type")})
|
|
74
74
|
return _obj
|
|
@@ -36,7 +36,7 @@ class ImageContentPart(BaseModel):
|
|
|
36
36
|
@validator("type")
|
|
37
37
|
def type_validate_enum(cls, value):
|
|
38
38
|
"""Validates the enum"""
|
|
39
|
-
if value not in ("image_url"):
|
|
39
|
+
if value not in ("image_url",):
|
|
40
40
|
raise ValueError("must be one of enum values ('image_url')")
|
|
41
41
|
return value
|
|
42
42
|
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
FastAPI
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 0.1.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
from __future__ import annotations
|
|
15
|
+
|
|
16
|
+
import json
|
|
17
|
+
import pprint
|
|
18
|
+
import re # noqa: F401
|
|
19
|
+
|
|
20
|
+
from truefoundry.pydantic_v1 import BaseModel, Field, StrictStr, validator
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class KerasFramework(BaseModel):
|
|
24
|
+
"""
|
|
25
|
+
+docs=Keras framework for the model version +label=Keras # noqa: E501
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
type: StrictStr = Field(
|
|
29
|
+
default=..., description="+label=Type +usage=Type of the framework +value=keras"
|
|
30
|
+
)
|
|
31
|
+
__properties = ["type"]
|
|
32
|
+
|
|
33
|
+
@validator("type")
|
|
34
|
+
def type_validate_enum(cls, value):
|
|
35
|
+
"""Validates the enum"""
|
|
36
|
+
if value not in ("keras",):
|
|
37
|
+
raise ValueError("must be one of enum values ('keras')")
|
|
38
|
+
return value
|
|
39
|
+
|
|
40
|
+
class Config:
|
|
41
|
+
"""Pydantic configuration"""
|
|
42
|
+
|
|
43
|
+
allow_population_by_field_name = True
|
|
44
|
+
validate_assignment = True
|
|
45
|
+
|
|
46
|
+
def to_str(self) -> str:
|
|
47
|
+
"""Returns the string representation of the model using alias"""
|
|
48
|
+
return pprint.pformat(self.dict(by_alias=True))
|
|
49
|
+
|
|
50
|
+
def to_json(self) -> str:
|
|
51
|
+
"""Returns the JSON representation of the model using alias"""
|
|
52
|
+
return json.dumps(self.to_dict())
|
|
53
|
+
|
|
54
|
+
@classmethod
|
|
55
|
+
def from_json(cls, json_str: str) -> KerasFramework:
|
|
56
|
+
"""Create an instance of KerasFramework from a JSON string"""
|
|
57
|
+
return cls.from_dict(json.loads(json_str))
|
|
58
|
+
|
|
59
|
+
def to_dict(self):
|
|
60
|
+
"""Returns the dictionary representation of the model using alias"""
|
|
61
|
+
_dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
|
|
62
|
+
return _dict
|
|
63
|
+
|
|
64
|
+
@classmethod
|
|
65
|
+
def from_dict(cls, obj: dict) -> KerasFramework:
|
|
66
|
+
"""Create an instance of KerasFramework from a dict"""
|
|
67
|
+
if obj is None:
|
|
68
|
+
return None
|
|
69
|
+
|
|
70
|
+
if not isinstance(obj, dict):
|
|
71
|
+
return KerasFramework.parse_obj(obj)
|
|
72
|
+
|
|
73
|
+
_obj = KerasFramework.parse_obj({"type": obj.get("type")})
|
|
74
|
+
return _obj
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
FastAPI
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 0.1.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
from __future__ import annotations
|
|
15
|
+
|
|
16
|
+
import json
|
|
17
|
+
import pprint
|
|
18
|
+
import re # noqa: F401
|
|
19
|
+
|
|
20
|
+
from truefoundry.pydantic_v1 import BaseModel, Field, StrictStr, validator
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class LightGBMFramework(BaseModel):
|
|
24
|
+
"""
|
|
25
|
+
+docs=LightGBM framework for the model version +label=LightGBM # noqa: E501
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
type: StrictStr = Field(
|
|
29
|
+
default=...,
|
|
30
|
+
description="+label=Type +usage=Type of the framework +value=lightgbm",
|
|
31
|
+
)
|
|
32
|
+
__properties = ["type"]
|
|
33
|
+
|
|
34
|
+
@validator("type")
|
|
35
|
+
def type_validate_enum(cls, value):
|
|
36
|
+
"""Validates the enum"""
|
|
37
|
+
if value not in ("lightgbm",):
|
|
38
|
+
raise ValueError("must be one of enum values ('lightgbm')")
|
|
39
|
+
return value
|
|
40
|
+
|
|
41
|
+
class Config:
|
|
42
|
+
"""Pydantic configuration"""
|
|
43
|
+
|
|
44
|
+
allow_population_by_field_name = True
|
|
45
|
+
validate_assignment = True
|
|
46
|
+
|
|
47
|
+
def to_str(self) -> str:
|
|
48
|
+
"""Returns the string representation of the model using alias"""
|
|
49
|
+
return pprint.pformat(self.dict(by_alias=True))
|
|
50
|
+
|
|
51
|
+
def to_json(self) -> str:
|
|
52
|
+
"""Returns the JSON representation of the model using alias"""
|
|
53
|
+
return json.dumps(self.to_dict())
|
|
54
|
+
|
|
55
|
+
@classmethod
|
|
56
|
+
def from_json(cls, json_str: str) -> LightGBMFramework:
|
|
57
|
+
"""Create an instance of LightGBMFramework from a JSON string"""
|
|
58
|
+
return cls.from_dict(json.loads(json_str))
|
|
59
|
+
|
|
60
|
+
def to_dict(self):
|
|
61
|
+
"""Returns the dictionary representation of the model using alias"""
|
|
62
|
+
_dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
|
|
63
|
+
return _dict
|
|
64
|
+
|
|
65
|
+
@classmethod
|
|
66
|
+
def from_dict(cls, obj: dict) -> LightGBMFramework:
|
|
67
|
+
"""Create an instance of LightGBMFramework from a dict"""
|
|
68
|
+
if obj is None:
|
|
69
|
+
return None
|
|
70
|
+
|
|
71
|
+
if not isinstance(obj, dict):
|
|
72
|
+
return LightGBMFramework.parse_obj(obj)
|
|
73
|
+
|
|
74
|
+
_obj = LightGBMFramework.parse_obj({"type": obj.get("type")})
|
|
75
|
+
return _obj
|