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
|
@@ -0,0 +1,111 @@
|
|
|
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
|
+
from typing import Any, Dict, Optional
|
|
20
|
+
|
|
21
|
+
from truefoundry.ml.autogen.client.models.source import Source
|
|
22
|
+
from truefoundry.pydantic_v1 import (
|
|
23
|
+
BaseModel,
|
|
24
|
+
Field,
|
|
25
|
+
StrictStr,
|
|
26
|
+
conint,
|
|
27
|
+
constr,
|
|
28
|
+
validator,
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
class ArtifactVersionManifest(BaseModel):
|
|
33
|
+
"""
|
|
34
|
+
Artifact Version manifest. # noqa: E501
|
|
35
|
+
"""
|
|
36
|
+
|
|
37
|
+
description: Optional[constr(strict=True, max_length=512)] = Field(
|
|
38
|
+
default=None,
|
|
39
|
+
description="+label=Description +docs=Description of the artifact version",
|
|
40
|
+
)
|
|
41
|
+
metadata: Dict[str, Any] = Field(
|
|
42
|
+
default=...,
|
|
43
|
+
description="+label=Metadata +docs=Metadata for the model version +usage=Metadata for the model version +uiType=JsonInput",
|
|
44
|
+
)
|
|
45
|
+
type: Optional[StrictStr] = "artifact-version"
|
|
46
|
+
source: Source = Field(...)
|
|
47
|
+
step: Optional[conint(strict=True, ge=0)] = Field(
|
|
48
|
+
default=0, description="+label=Step"
|
|
49
|
+
)
|
|
50
|
+
__properties = ["description", "metadata", "type", "source", "step"]
|
|
51
|
+
|
|
52
|
+
@validator("type")
|
|
53
|
+
def type_validate_enum(cls, value):
|
|
54
|
+
"""Validates the enum"""
|
|
55
|
+
if value is None:
|
|
56
|
+
return value
|
|
57
|
+
|
|
58
|
+
if value not in ("artifact-version",):
|
|
59
|
+
raise ValueError("must be one of enum values ('artifact-version')")
|
|
60
|
+
return value
|
|
61
|
+
|
|
62
|
+
class Config:
|
|
63
|
+
"""Pydantic configuration"""
|
|
64
|
+
|
|
65
|
+
allow_population_by_field_name = True
|
|
66
|
+
validate_assignment = True
|
|
67
|
+
|
|
68
|
+
def to_str(self) -> str:
|
|
69
|
+
"""Returns the string representation of the model using alias"""
|
|
70
|
+
return pprint.pformat(self.dict(by_alias=True))
|
|
71
|
+
|
|
72
|
+
def to_json(self) -> str:
|
|
73
|
+
"""Returns the JSON representation of the model using alias"""
|
|
74
|
+
return json.dumps(self.to_dict())
|
|
75
|
+
|
|
76
|
+
@classmethod
|
|
77
|
+
def from_json(cls, json_str: str) -> ArtifactVersionManifest:
|
|
78
|
+
"""Create an instance of ArtifactVersionManifest from a JSON string"""
|
|
79
|
+
return cls.from_dict(json.loads(json_str))
|
|
80
|
+
|
|
81
|
+
def to_dict(self):
|
|
82
|
+
"""Returns the dictionary representation of the model using alias"""
|
|
83
|
+
_dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
|
|
84
|
+
# override the default output from truefoundry.pydantic_v1 by calling `to_dict()` of source
|
|
85
|
+
if self.source:
|
|
86
|
+
_dict["source"] = self.source.to_dict()
|
|
87
|
+
return _dict
|
|
88
|
+
|
|
89
|
+
@classmethod
|
|
90
|
+
def from_dict(cls, obj: dict) -> ArtifactVersionManifest:
|
|
91
|
+
"""Create an instance of ArtifactVersionManifest from a dict"""
|
|
92
|
+
if obj is None:
|
|
93
|
+
return None
|
|
94
|
+
|
|
95
|
+
if not isinstance(obj, dict):
|
|
96
|
+
return ArtifactVersionManifest.parse_obj(obj)
|
|
97
|
+
|
|
98
|
+
_obj = ArtifactVersionManifest.parse_obj(
|
|
99
|
+
{
|
|
100
|
+
"description": obj.get("description"),
|
|
101
|
+
"metadata": obj.get("metadata"),
|
|
102
|
+
"type": obj.get("type")
|
|
103
|
+
if obj.get("type") is not None
|
|
104
|
+
else "artifact-version",
|
|
105
|
+
"source": Source.from_dict(obj.get("source"))
|
|
106
|
+
if obj.get("source") is not None
|
|
107
|
+
else None,
|
|
108
|
+
"step": obj.get("step") if obj.get("step") is not None else 0,
|
|
109
|
+
}
|
|
110
|
+
)
|
|
111
|
+
return _obj
|
|
@@ -37,7 +37,7 @@ class AssistantMessage(BaseModel):
|
|
|
37
37
|
@validator("role")
|
|
38
38
|
def role_validate_enum(cls, value):
|
|
39
39
|
"""Validates the enum"""
|
|
40
|
-
if value not in ("assistant"):
|
|
40
|
+
if value not in ("assistant",):
|
|
41
41
|
raise ValueError("must be one of enum values ('assistant')")
|
|
42
42
|
return value
|
|
43
43
|
|
|
@@ -39,7 +39,7 @@ class BlobStorageReference(BaseModel):
|
|
|
39
39
|
@validator("type")
|
|
40
40
|
def type_validate_enum(cls, value):
|
|
41
41
|
"""Validates the enum"""
|
|
42
|
-
if value not in ("blob-storage"):
|
|
42
|
+
if value not in ("blob-storage",):
|
|
43
43
|
raise ValueError("must be one of enum values ('blob-storage')")
|
|
44
44
|
return value
|
|
45
45
|
|
|
@@ -0,0 +1,152 @@
|
|
|
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
|
+
from typing import TYPE_CHECKING, Any, List, Optional, Union
|
|
20
|
+
|
|
21
|
+
from truefoundry.pydantic_v1 import (
|
|
22
|
+
BaseModel,
|
|
23
|
+
Field,
|
|
24
|
+
StrictStr,
|
|
25
|
+
ValidationError,
|
|
26
|
+
conlist,
|
|
27
|
+
validator,
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
COMMAND_ANY_OF_SCHEMAS = ["List[str]", "str"]
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class Command(BaseModel):
|
|
34
|
+
"""
|
|
35
|
+
Command
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
# data type: str
|
|
39
|
+
anyof_schema_1_validator: Optional[StrictStr] = None
|
|
40
|
+
# data type: List[str]
|
|
41
|
+
anyof_schema_2_validator: Optional[conlist(StrictStr)] = None
|
|
42
|
+
if TYPE_CHECKING:
|
|
43
|
+
actual_instance: Union[List[str], str]
|
|
44
|
+
else:
|
|
45
|
+
actual_instance: Any
|
|
46
|
+
any_of_schemas: List[str] = Field(COMMAND_ANY_OF_SCHEMAS, const=True)
|
|
47
|
+
|
|
48
|
+
class Config:
|
|
49
|
+
validate_assignment = True
|
|
50
|
+
|
|
51
|
+
def __init__(self, *args, **kwargs) -> None:
|
|
52
|
+
if args:
|
|
53
|
+
if len(args) > 1:
|
|
54
|
+
raise ValueError(
|
|
55
|
+
"If a position argument is used, only 1 is allowed to set `actual_instance`"
|
|
56
|
+
)
|
|
57
|
+
if kwargs:
|
|
58
|
+
raise ValueError(
|
|
59
|
+
"If a position argument is used, keyword arguments cannot be used."
|
|
60
|
+
)
|
|
61
|
+
super().__init__(actual_instance=args[0])
|
|
62
|
+
else:
|
|
63
|
+
super().__init__(**kwargs)
|
|
64
|
+
|
|
65
|
+
@validator("actual_instance")
|
|
66
|
+
def actual_instance_must_validate_anyof(cls, v):
|
|
67
|
+
instance = Command.construct()
|
|
68
|
+
error_messages = []
|
|
69
|
+
# validate data type: str
|
|
70
|
+
try:
|
|
71
|
+
instance.anyof_schema_1_validator = v
|
|
72
|
+
return v
|
|
73
|
+
except (ValidationError, ValueError) as e:
|
|
74
|
+
error_messages.append(str(e))
|
|
75
|
+
# validate data type: List[str]
|
|
76
|
+
try:
|
|
77
|
+
instance.anyof_schema_2_validator = v
|
|
78
|
+
return v
|
|
79
|
+
except (ValidationError, ValueError) as e:
|
|
80
|
+
error_messages.append(str(e))
|
|
81
|
+
if error_messages:
|
|
82
|
+
# no match
|
|
83
|
+
raise ValueError(
|
|
84
|
+
"No match found when setting the actual_instance in Command with anyOf schemas: List[str], str. Details: "
|
|
85
|
+
+ ", ".join(error_messages)
|
|
86
|
+
)
|
|
87
|
+
else:
|
|
88
|
+
return v
|
|
89
|
+
|
|
90
|
+
@classmethod
|
|
91
|
+
def from_dict(cls, obj: dict) -> Command:
|
|
92
|
+
return cls.from_json(json.dumps(obj))
|
|
93
|
+
|
|
94
|
+
@classmethod
|
|
95
|
+
def from_json(cls, json_str: str) -> Command:
|
|
96
|
+
"""Returns the object represented by the json string"""
|
|
97
|
+
instance = Command.construct()
|
|
98
|
+
error_messages = []
|
|
99
|
+
# deserialize data into str
|
|
100
|
+
try:
|
|
101
|
+
# validation
|
|
102
|
+
instance.anyof_schema_1_validator = json.loads(json_str)
|
|
103
|
+
# assign value to actual_instance
|
|
104
|
+
instance.actual_instance = instance.anyof_schema_1_validator
|
|
105
|
+
return instance
|
|
106
|
+
except (ValidationError, ValueError) as e:
|
|
107
|
+
error_messages.append(str(e))
|
|
108
|
+
# deserialize data into List[str]
|
|
109
|
+
try:
|
|
110
|
+
# validation
|
|
111
|
+
instance.anyof_schema_2_validator = json.loads(json_str)
|
|
112
|
+
# assign value to actual_instance
|
|
113
|
+
instance.actual_instance = instance.anyof_schema_2_validator
|
|
114
|
+
return instance
|
|
115
|
+
except (ValidationError, ValueError) as e:
|
|
116
|
+
error_messages.append(str(e))
|
|
117
|
+
|
|
118
|
+
if error_messages:
|
|
119
|
+
# no match
|
|
120
|
+
raise ValueError(
|
|
121
|
+
"No match found when deserializing the JSON string into Command with anyOf schemas: List[str], str. Details: "
|
|
122
|
+
+ ", ".join(error_messages)
|
|
123
|
+
)
|
|
124
|
+
else:
|
|
125
|
+
return instance
|
|
126
|
+
|
|
127
|
+
def to_json(self) -> str:
|
|
128
|
+
"""Returns the JSON representation of the actual instance"""
|
|
129
|
+
if self.actual_instance is None:
|
|
130
|
+
return "null"
|
|
131
|
+
|
|
132
|
+
to_json = getattr(self.actual_instance, "to_json", None)
|
|
133
|
+
if callable(to_json):
|
|
134
|
+
return self.actual_instance.to_json()
|
|
135
|
+
else:
|
|
136
|
+
return json.dumps(self.actual_instance)
|
|
137
|
+
|
|
138
|
+
def to_dict(self) -> dict:
|
|
139
|
+
"""Returns the dict representation of the actual instance"""
|
|
140
|
+
if self.actual_instance is None:
|
|
141
|
+
return "null"
|
|
142
|
+
|
|
143
|
+
to_json = getattr(self.actual_instance, "to_json", None)
|
|
144
|
+
if callable(to_json):
|
|
145
|
+
return self.actual_instance.to_dict()
|
|
146
|
+
else:
|
|
147
|
+
# primitive type
|
|
148
|
+
return self.actual_instance
|
|
149
|
+
|
|
150
|
+
def to_str(self) -> str:
|
|
151
|
+
"""Returns the string representation of the actual instance"""
|
|
152
|
+
return pprint.pformat(self.dict())
|
truefoundry/ml/autogen/client/models/{feature_dto.py → create_workflow_task_config_request_dto.py}
RENAMED
|
@@ -16,20 +16,19 @@ from __future__ import annotations
|
|
|
16
16
|
import json
|
|
17
17
|
import pprint
|
|
18
18
|
import re # noqa: F401
|
|
19
|
-
from typing import Optional
|
|
19
|
+
from typing import Any, Dict, Optional
|
|
20
20
|
|
|
21
|
-
from truefoundry.ml.autogen.client.models.feature_value_type import FeatureValueType
|
|
22
21
|
from truefoundry.pydantic_v1 import BaseModel, StrictStr
|
|
23
22
|
|
|
24
23
|
|
|
25
|
-
class
|
|
24
|
+
class CreateWorkflowTaskConfigRequestDto(BaseModel):
|
|
26
25
|
"""
|
|
27
|
-
|
|
26
|
+
CreateWorkflowTaskConfigRequestDto
|
|
28
27
|
"""
|
|
29
28
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
__properties = ["
|
|
29
|
+
task_name: Optional[StrictStr] = None
|
|
30
|
+
workflow_task_config: Optional[Dict[str, Any]] = None
|
|
31
|
+
__properties = ["task_name", "workflow_task_config"]
|
|
33
32
|
|
|
34
33
|
class Config:
|
|
35
34
|
"""Pydantic configuration"""
|
|
@@ -46,8 +45,8 @@ class FeatureDto(BaseModel):
|
|
|
46
45
|
return json.dumps(self.to_dict())
|
|
47
46
|
|
|
48
47
|
@classmethod
|
|
49
|
-
def from_json(cls, json_str: str) ->
|
|
50
|
-
"""Create an instance of
|
|
48
|
+
def from_json(cls, json_str: str) -> CreateWorkflowTaskConfigRequestDto:
|
|
49
|
+
"""Create an instance of CreateWorkflowTaskConfigRequestDto from a JSON string"""
|
|
51
50
|
return cls.from_dict(json.loads(json_str))
|
|
52
51
|
|
|
53
52
|
def to_dict(self):
|
|
@@ -56,13 +55,18 @@ class FeatureDto(BaseModel):
|
|
|
56
55
|
return _dict
|
|
57
56
|
|
|
58
57
|
@classmethod
|
|
59
|
-
def from_dict(cls, obj: dict) ->
|
|
60
|
-
"""Create an instance of
|
|
58
|
+
def from_dict(cls, obj: dict) -> CreateWorkflowTaskConfigRequestDto:
|
|
59
|
+
"""Create an instance of CreateWorkflowTaskConfigRequestDto from a dict"""
|
|
61
60
|
if obj is None:
|
|
62
61
|
return None
|
|
63
62
|
|
|
64
63
|
if not isinstance(obj, dict):
|
|
65
|
-
return
|
|
66
|
-
|
|
67
|
-
_obj =
|
|
64
|
+
return CreateWorkflowTaskConfigRequestDto.parse_obj(obj)
|
|
65
|
+
|
|
66
|
+
_obj = CreateWorkflowTaskConfigRequestDto.parse_obj(
|
|
67
|
+
{
|
|
68
|
+
"task_name": obj.get("task_name"),
|
|
69
|
+
"workflow_task_config": obj.get("workflow_task_config"),
|
|
70
|
+
}
|
|
71
|
+
)
|
|
68
72
|
return _obj
|
truefoundry/ml/autogen/client/models/{external_model_source.py → external_artifact_source.py}
RENAMED
|
@@ -20,23 +20,24 @@ import re # noqa: F401
|
|
|
20
20
|
from truefoundry.pydantic_v1 import BaseModel, Field, StrictStr, validator
|
|
21
21
|
|
|
22
22
|
|
|
23
|
-
class
|
|
23
|
+
class ExternalArtifactSource(BaseModel):
|
|
24
24
|
"""
|
|
25
|
-
|
|
25
|
+
+label=External # noqa: E501
|
|
26
26
|
"""
|
|
27
27
|
|
|
28
28
|
type: StrictStr = Field(
|
|
29
|
-
default=...,
|
|
29
|
+
default=...,
|
|
30
|
+
description="+label=Type +usage=Type of the source +value=external +type=External",
|
|
30
31
|
)
|
|
31
32
|
uri: StrictStr = Field(
|
|
32
|
-
default=..., description="+label=URI +usage=URI of the
|
|
33
|
+
default=..., description="+label=URI +usage=URI of the Artifact source"
|
|
33
34
|
)
|
|
34
35
|
__properties = ["type", "uri"]
|
|
35
36
|
|
|
36
37
|
@validator("type")
|
|
37
38
|
def type_validate_enum(cls, value):
|
|
38
39
|
"""Validates the enum"""
|
|
39
|
-
if value not in ("external"):
|
|
40
|
+
if value not in ("external",):
|
|
40
41
|
raise ValueError("must be one of enum values ('external')")
|
|
41
42
|
return value
|
|
42
43
|
|
|
@@ -55,8 +56,8 @@ class ExternalModelSource(BaseModel):
|
|
|
55
56
|
return json.dumps(self.to_dict())
|
|
56
57
|
|
|
57
58
|
@classmethod
|
|
58
|
-
def from_json(cls, json_str: str) ->
|
|
59
|
-
"""Create an instance of
|
|
59
|
+
def from_json(cls, json_str: str) -> ExternalArtifactSource:
|
|
60
|
+
"""Create an instance of ExternalArtifactSource from a JSON string"""
|
|
60
61
|
return cls.from_dict(json.loads(json_str))
|
|
61
62
|
|
|
62
63
|
def to_dict(self):
|
|
@@ -65,15 +66,15 @@ class ExternalModelSource(BaseModel):
|
|
|
65
66
|
return _dict
|
|
66
67
|
|
|
67
68
|
@classmethod
|
|
68
|
-
def from_dict(cls, obj: dict) ->
|
|
69
|
-
"""Create an instance of
|
|
69
|
+
def from_dict(cls, obj: dict) -> ExternalArtifactSource:
|
|
70
|
+
"""Create an instance of ExternalArtifactSource from a dict"""
|
|
70
71
|
if obj is None:
|
|
71
72
|
return None
|
|
72
73
|
|
|
73
74
|
if not isinstance(obj, dict):
|
|
74
|
-
return
|
|
75
|
+
return ExternalArtifactSource.parse_obj(obj)
|
|
75
76
|
|
|
76
|
-
_obj =
|
|
77
|
+
_obj = ExternalArtifactSource.parse_obj(
|
|
77
78
|
{"type": obj.get("type"), "uri": obj.get("uri")}
|
|
78
79
|
)
|
|
79
80
|
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 FastAIFramework(BaseModel):
|
|
24
|
+
"""
|
|
25
|
+
+docs=FastAI framework for the model version +label=FastAI # noqa: E501
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
type: StrictStr = Field(
|
|
29
|
+
default=...,
|
|
30
|
+
description="+label=Type +usage=Type of the framework +value=fastai",
|
|
31
|
+
)
|
|
32
|
+
__properties = ["type"]
|
|
33
|
+
|
|
34
|
+
@validator("type")
|
|
35
|
+
def type_validate_enum(cls, value):
|
|
36
|
+
"""Validates the enum"""
|
|
37
|
+
if value not in ("fastai",):
|
|
38
|
+
raise ValueError("must be one of enum values ('fastai')")
|
|
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) -> FastAIFramework:
|
|
57
|
+
"""Create an instance of FastAIFramework 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) -> FastAIFramework:
|
|
67
|
+
"""Create an instance of FastAIFramework from a dict"""
|
|
68
|
+
if obj is None:
|
|
69
|
+
return None
|
|
70
|
+
|
|
71
|
+
if not isinstance(obj, dict):
|
|
72
|
+
return FastAIFramework.parse_obj(obj)
|
|
73
|
+
|
|
74
|
+
_obj = FastAIFramework.parse_obj({"type": obj.get("type")})
|
|
75
|
+
return _obj
|
|
@@ -19,9 +19,7 @@ import re # noqa: F401
|
|
|
19
19
|
from typing import Any, Dict, Optional
|
|
20
20
|
|
|
21
21
|
from truefoundry.ml.autogen.client.models.internal_metadata import InternalMetadata
|
|
22
|
-
from truefoundry.ml.autogen.client.models.
|
|
23
|
-
ModelVersionManifest,
|
|
24
|
-
)
|
|
22
|
+
from truefoundry.ml.autogen.client.models.manifest import Manifest
|
|
25
23
|
from truefoundry.pydantic_v1 import BaseModel, Field, StrictInt, StrictStr
|
|
26
24
|
|
|
27
25
|
|
|
@@ -38,7 +36,7 @@ class FinalizeArtifactVersionRequestDto(BaseModel):
|
|
|
38
36
|
data_path: Optional[StrictStr] = None
|
|
39
37
|
step: Optional[StrictInt] = None
|
|
40
38
|
artifact_size: Optional[StrictInt] = None
|
|
41
|
-
manifest: Optional[
|
|
39
|
+
manifest: Optional[Manifest] = None
|
|
42
40
|
__properties = [
|
|
43
41
|
"id",
|
|
44
42
|
"run_uuid",
|
|
@@ -104,7 +102,7 @@ class FinalizeArtifactVersionRequestDto(BaseModel):
|
|
|
104
102
|
"data_path": obj.get("data_path"),
|
|
105
103
|
"step": obj.get("step"),
|
|
106
104
|
"artifact_size": obj.get("artifact_size"),
|
|
107
|
-
"manifest":
|
|
105
|
+
"manifest": Manifest.from_dict(obj.get("manifest"))
|
|
108
106
|
if obj.get("manifest") is not None
|
|
109
107
|
else None,
|
|
110
108
|
}
|