truefoundry 0.4.4rc9__py3-none-any.whl → 0.4.4rc10__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/ml/artifact/truefoundry_artifact_repo.py +433 -415
- truefoundry/ml/autogen/client/__init__.py +24 -3
- truefoundry/ml/autogen/client/api/experiments_api.py +0 -137
- truefoundry/ml/autogen/client/api/mlfoundry_artifacts_api.py +2 -0
- truefoundry/ml/autogen/client/models/__init__.py +24 -3
- truefoundry/ml/autogen/client/models/artifact_dto.py +9 -0
- truefoundry/ml/autogen/client/models/artifact_version_dto.py +26 -0
- truefoundry/ml/autogen/client/models/artifact_version_serialization_format.py +34 -0
- truefoundry/ml/autogen/client/models/create_artifact_version_response_dto.py +8 -2
- truefoundry/ml/autogen/client/models/create_run_request_dto.py +1 -10
- truefoundry/ml/autogen/client/models/dataset_dto.py +9 -0
- truefoundry/ml/autogen/client/models/experiment_dto.py +14 -3
- truefoundry/ml/autogen/client/models/external_model_source.py +79 -0
- truefoundry/ml/autogen/client/models/finalize_artifact_version_request_dto.py +11 -0
- truefoundry/ml/autogen/client/models/framework.py +154 -0
- truefoundry/ml/autogen/client/models/library_name.py +35 -0
- truefoundry/ml/autogen/client/models/model_dto.py +9 -0
- truefoundry/ml/autogen/client/models/model_version_dto.py +26 -0
- truefoundry/ml/autogen/client/models/model_version_manifest.py +119 -0
- truefoundry/ml/autogen/client/models/run_info_dto.py +10 -1
- truefoundry/ml/autogen/client/models/source.py +177 -0
- truefoundry/ml/autogen/client/models/subject.py +79 -0
- truefoundry/ml/autogen/client/models/subject_type.py +34 -0
- truefoundry/ml/autogen/client/models/tensorflow_framework.py +74 -0
- truefoundry/ml/autogen/client/models/transformers_framework.py +90 -0
- truefoundry/ml/autogen/client/models/truefoundry_model_source.py +79 -0
- truefoundry/ml/autogen/client/models/update_model_version_request_dto.py +11 -0
- truefoundry/ml/autogen/client/models/upload_model_source.py +74 -0
- truefoundry/ml/autogen/client_README.md +12 -2
- truefoundry/ml/autogen/entities/artifacts.py +236 -4
- truefoundry/ml/log_types/artifacts/artifact.py +10 -6
- truefoundry/ml/log_types/artifacts/dataset.py +13 -5
- truefoundry/ml/log_types/artifacts/general_artifact.py +3 -1
- truefoundry/ml/log_types/artifacts/model.py +18 -30
- truefoundry/ml/log_types/artifacts/utils.py +42 -25
- truefoundry/ml/log_types/image/image.py +2 -0
- truefoundry/ml/log_types/plot.py +2 -0
- truefoundry/ml/mlfoundry_api.py +0 -1
- {truefoundry-0.4.4rc9.dist-info → truefoundry-0.4.4rc10.dist-info}/METADATA +1 -1
- {truefoundry-0.4.4rc9.dist-info → truefoundry-0.4.4rc10.dist-info}/RECORD +42 -31
- truefoundry/ml/autogen/client/models/list_seed_experiments_response_dto.py +0 -81
- {truefoundry-0.4.4rc9.dist-info → truefoundry-0.4.4rc10.dist-info}/WHEEL +0 -0
- {truefoundry-0.4.4rc9.dist-info → truefoundry-0.4.4rc10.dist-info}/entry_points.txt +0 -0
|
@@ -0,0 +1,177 @@
|
|
|
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.ml.autogen.client.models.external_model_source import (
|
|
22
|
+
ExternalModelSource,
|
|
23
|
+
)
|
|
24
|
+
from truefoundry.ml.autogen.client.models.truefoundry_model_source import (
|
|
25
|
+
TruefoundryModelSource,
|
|
26
|
+
)
|
|
27
|
+
from truefoundry.ml.autogen.client.models.upload_model_source import UploadModelSource
|
|
28
|
+
from truefoundry.pydantic_v1 import (
|
|
29
|
+
BaseModel,
|
|
30
|
+
Field,
|
|
31
|
+
ValidationError,
|
|
32
|
+
validator,
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
SOURCE_ANY_OF_SCHEMAS = [
|
|
36
|
+
"ExternalModelSource",
|
|
37
|
+
"TruefoundryModelSource",
|
|
38
|
+
"UploadModelSource",
|
|
39
|
+
]
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
class Source(BaseModel):
|
|
43
|
+
"""
|
|
44
|
+
+label=Artifact Source +docs=Source for the model version +usage=Source for the model version
|
|
45
|
+
"""
|
|
46
|
+
|
|
47
|
+
# data type: UploadModelSource
|
|
48
|
+
anyof_schema_1_validator: Optional[UploadModelSource] = None
|
|
49
|
+
# data type: TruefoundryModelSource
|
|
50
|
+
anyof_schema_2_validator: Optional[TruefoundryModelSource] = None
|
|
51
|
+
# data type: ExternalModelSource
|
|
52
|
+
anyof_schema_3_validator: Optional[ExternalModelSource] = None
|
|
53
|
+
if TYPE_CHECKING:
|
|
54
|
+
actual_instance: Union[
|
|
55
|
+
ExternalModelSource, TruefoundryModelSource, UploadModelSource
|
|
56
|
+
]
|
|
57
|
+
else:
|
|
58
|
+
actual_instance: Any
|
|
59
|
+
any_of_schemas: List[str] = Field(SOURCE_ANY_OF_SCHEMAS, const=True)
|
|
60
|
+
|
|
61
|
+
class Config:
|
|
62
|
+
validate_assignment = True
|
|
63
|
+
|
|
64
|
+
def __init__(self, *args, **kwargs) -> None:
|
|
65
|
+
if args:
|
|
66
|
+
if len(args) > 1:
|
|
67
|
+
raise ValueError(
|
|
68
|
+
"If a position argument is used, only 1 is allowed to set `actual_instance`"
|
|
69
|
+
)
|
|
70
|
+
if kwargs:
|
|
71
|
+
raise ValueError(
|
|
72
|
+
"If a position argument is used, keyword arguments cannot be used."
|
|
73
|
+
)
|
|
74
|
+
super().__init__(actual_instance=args[0])
|
|
75
|
+
else:
|
|
76
|
+
super().__init__(**kwargs)
|
|
77
|
+
|
|
78
|
+
@validator("actual_instance")
|
|
79
|
+
def actual_instance_must_validate_anyof(cls, v):
|
|
80
|
+
instance = Source.construct()
|
|
81
|
+
error_messages = []
|
|
82
|
+
# validate data type: UploadModelSource
|
|
83
|
+
if not isinstance(v, UploadModelSource):
|
|
84
|
+
error_messages.append(
|
|
85
|
+
f"Error! Input type `{type(v)}` is not `UploadModelSource`"
|
|
86
|
+
)
|
|
87
|
+
else:
|
|
88
|
+
return v
|
|
89
|
+
|
|
90
|
+
# validate data type: TruefoundryModelSource
|
|
91
|
+
if not isinstance(v, TruefoundryModelSource):
|
|
92
|
+
error_messages.append(
|
|
93
|
+
f"Error! Input type `{type(v)}` is not `TruefoundryModelSource`"
|
|
94
|
+
)
|
|
95
|
+
else:
|
|
96
|
+
return v
|
|
97
|
+
|
|
98
|
+
# validate data type: ExternalModelSource
|
|
99
|
+
if not isinstance(v, ExternalModelSource):
|
|
100
|
+
error_messages.append(
|
|
101
|
+
f"Error! Input type `{type(v)}` is not `ExternalModelSource`"
|
|
102
|
+
)
|
|
103
|
+
else:
|
|
104
|
+
return v
|
|
105
|
+
|
|
106
|
+
if error_messages:
|
|
107
|
+
# no match
|
|
108
|
+
raise ValueError(
|
|
109
|
+
"No match found when setting the actual_instance in Source with anyOf schemas: ExternalModelSource, TruefoundryModelSource, UploadModelSource. Details: "
|
|
110
|
+
+ ", ".join(error_messages)
|
|
111
|
+
)
|
|
112
|
+
else:
|
|
113
|
+
return v
|
|
114
|
+
|
|
115
|
+
@classmethod
|
|
116
|
+
def from_dict(cls, obj: dict) -> Source:
|
|
117
|
+
return cls.from_json(json.dumps(obj))
|
|
118
|
+
|
|
119
|
+
@classmethod
|
|
120
|
+
def from_json(cls, json_str: str) -> Source:
|
|
121
|
+
"""Returns the object represented by the json string"""
|
|
122
|
+
instance = Source.construct()
|
|
123
|
+
error_messages = []
|
|
124
|
+
# anyof_schema_1_validator: Optional[UploadModelSource] = None
|
|
125
|
+
try:
|
|
126
|
+
instance.actual_instance = UploadModelSource.from_json(json_str)
|
|
127
|
+
return instance
|
|
128
|
+
except (ValidationError, ValueError) as e:
|
|
129
|
+
error_messages.append(str(e))
|
|
130
|
+
# anyof_schema_2_validator: Optional[TruefoundryModelSource] = None
|
|
131
|
+
try:
|
|
132
|
+
instance.actual_instance = TruefoundryModelSource.from_json(json_str)
|
|
133
|
+
return instance
|
|
134
|
+
except (ValidationError, ValueError) as e:
|
|
135
|
+
error_messages.append(str(e))
|
|
136
|
+
# anyof_schema_3_validator: Optional[ExternalModelSource] = None
|
|
137
|
+
try:
|
|
138
|
+
instance.actual_instance = ExternalModelSource.from_json(json_str)
|
|
139
|
+
return instance
|
|
140
|
+
except (ValidationError, ValueError) as e:
|
|
141
|
+
error_messages.append(str(e))
|
|
142
|
+
|
|
143
|
+
if error_messages:
|
|
144
|
+
# no match
|
|
145
|
+
raise ValueError(
|
|
146
|
+
"No match found when deserializing the JSON string into Source with anyOf schemas: ExternalModelSource, TruefoundryModelSource, UploadModelSource. Details: "
|
|
147
|
+
+ ", ".join(error_messages)
|
|
148
|
+
)
|
|
149
|
+
else:
|
|
150
|
+
return instance
|
|
151
|
+
|
|
152
|
+
def to_json(self) -> str:
|
|
153
|
+
"""Returns the JSON representation of the actual instance"""
|
|
154
|
+
if self.actual_instance is None:
|
|
155
|
+
return "null"
|
|
156
|
+
|
|
157
|
+
to_json = getattr(self.actual_instance, "to_json", None)
|
|
158
|
+
if callable(to_json):
|
|
159
|
+
return self.actual_instance.to_json()
|
|
160
|
+
else:
|
|
161
|
+
return json.dumps(self.actual_instance)
|
|
162
|
+
|
|
163
|
+
def to_dict(self) -> dict:
|
|
164
|
+
"""Returns the dict representation of the actual instance"""
|
|
165
|
+
if self.actual_instance is None:
|
|
166
|
+
return "null"
|
|
167
|
+
|
|
168
|
+
to_json = getattr(self.actual_instance, "to_json", None)
|
|
169
|
+
if callable(to_json):
|
|
170
|
+
return self.actual_instance.to_dict()
|
|
171
|
+
else:
|
|
172
|
+
# primitive type
|
|
173
|
+
return self.actual_instance
|
|
174
|
+
|
|
175
|
+
def to_str(self) -> str:
|
|
176
|
+
"""Returns the string representation of the actual instance"""
|
|
177
|
+
return pprint.pformat(self.dict())
|
|
@@ -0,0 +1,79 @@
|
|
|
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 Optional
|
|
20
|
+
|
|
21
|
+
from truefoundry.ml.autogen.client.models.subject_type import SubjectType
|
|
22
|
+
from truefoundry.pydantic_v1 import BaseModel, Field, StrictStr
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class Subject(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
Subject
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
subject_id: StrictStr = Field(default=..., alias="subjectId")
|
|
31
|
+
subject_type: Optional[SubjectType] = Field(default=None, alias="subjectType")
|
|
32
|
+
subject_slug: StrictStr = Field(default=..., alias="subjectSlug")
|
|
33
|
+
subject_display_name: Optional[StrictStr] = Field(
|
|
34
|
+
default=None, alias="subjectDisplayName"
|
|
35
|
+
)
|
|
36
|
+
__properties = ["subjectId", "subjectType", "subjectSlug", "subjectDisplayName"]
|
|
37
|
+
|
|
38
|
+
class Config:
|
|
39
|
+
"""Pydantic configuration"""
|
|
40
|
+
|
|
41
|
+
allow_population_by_field_name = True
|
|
42
|
+
validate_assignment = True
|
|
43
|
+
|
|
44
|
+
def to_str(self) -> str:
|
|
45
|
+
"""Returns the string representation of the model using alias"""
|
|
46
|
+
return pprint.pformat(self.dict(by_alias=True))
|
|
47
|
+
|
|
48
|
+
def to_json(self) -> str:
|
|
49
|
+
"""Returns the JSON representation of the model using alias"""
|
|
50
|
+
return json.dumps(self.to_dict())
|
|
51
|
+
|
|
52
|
+
@classmethod
|
|
53
|
+
def from_json(cls, json_str: str) -> Subject:
|
|
54
|
+
"""Create an instance of Subject from a JSON string"""
|
|
55
|
+
return cls.from_dict(json.loads(json_str))
|
|
56
|
+
|
|
57
|
+
def to_dict(self):
|
|
58
|
+
"""Returns the dictionary representation of the model using alias"""
|
|
59
|
+
_dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
|
|
60
|
+
return _dict
|
|
61
|
+
|
|
62
|
+
@classmethod
|
|
63
|
+
def from_dict(cls, obj: dict) -> Subject:
|
|
64
|
+
"""Create an instance of Subject from a dict"""
|
|
65
|
+
if obj is None:
|
|
66
|
+
return None
|
|
67
|
+
|
|
68
|
+
if not isinstance(obj, dict):
|
|
69
|
+
return Subject.parse_obj(obj)
|
|
70
|
+
|
|
71
|
+
_obj = Subject.parse_obj(
|
|
72
|
+
{
|
|
73
|
+
"subject_id": obj.get("subjectId"),
|
|
74
|
+
"subject_type": obj.get("subjectType"),
|
|
75
|
+
"subject_slug": obj.get("subjectSlug"),
|
|
76
|
+
"subject_display_name": obj.get("subjectDisplayName"),
|
|
77
|
+
}
|
|
78
|
+
)
|
|
79
|
+
return _obj
|
|
@@ -0,0 +1,34 @@
|
|
|
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
|
+
import json
|
|
15
|
+
import re # noqa: F401
|
|
16
|
+
|
|
17
|
+
from aenum import Enum
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class SubjectType(str, Enum):
|
|
21
|
+
"""
|
|
22
|
+
An enumeration.
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
"""
|
|
26
|
+
allowed enum values
|
|
27
|
+
"""
|
|
28
|
+
USER = "user"
|
|
29
|
+
SERVICEACCOUNT = "serviceaccount"
|
|
30
|
+
|
|
31
|
+
@classmethod
|
|
32
|
+
def from_json(cls, json_str: str) -> SubjectType:
|
|
33
|
+
"""Create an instance of SubjectType from a JSON string"""
|
|
34
|
+
return SubjectType(json.loads(json_str))
|
|
@@ -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 TensorflowFramework(BaseModel):
|
|
24
|
+
"""
|
|
25
|
+
+docs=Tensorflow framework for the model version +usage=Tensorflow framework for the model version +label=Tensorflow framework # noqa: E501
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
type: StrictStr = Field(
|
|
29
|
+
default=..., description="+label=Type +usage=Type of the framework"
|
|
30
|
+
)
|
|
31
|
+
__properties = ["type"]
|
|
32
|
+
|
|
33
|
+
@validator("type")
|
|
34
|
+
def type_validate_enum(cls, value):
|
|
35
|
+
"""Validates the enum"""
|
|
36
|
+
if value not in ("tensorflow"):
|
|
37
|
+
raise ValueError("must be one of enum values ('tensorflow')")
|
|
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) -> TensorflowFramework:
|
|
56
|
+
"""Create an instance of TensorflowFramework 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) -> TensorflowFramework:
|
|
66
|
+
"""Create an instance of TensorflowFramework from a dict"""
|
|
67
|
+
if obj is None:
|
|
68
|
+
return None
|
|
69
|
+
|
|
70
|
+
if not isinstance(obj, dict):
|
|
71
|
+
return TensorflowFramework.parse_obj(obj)
|
|
72
|
+
|
|
73
|
+
_obj = TensorflowFramework.parse_obj({"type": obj.get("type")})
|
|
74
|
+
return _obj
|
|
@@ -0,0 +1,90 @@
|
|
|
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 Optional
|
|
20
|
+
|
|
21
|
+
from truefoundry.ml.autogen.client.models.library_name import LibraryName
|
|
22
|
+
from truefoundry.pydantic_v1 import BaseModel, Field, StrictStr, validator
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class TransformersFramework(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
+docs=Transformers framework for the model version +usage=Transformers framework for the model version +label=Transformers framework # noqa: E501
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
type: StrictStr = Field(
|
|
31
|
+
default=..., description="+label=Type +usage=Type of the framework"
|
|
32
|
+
)
|
|
33
|
+
library_name: Optional[LibraryName] = Field(
|
|
34
|
+
default=None,
|
|
35
|
+
description="+label=Library Name +usage=Name of the library for the framework",
|
|
36
|
+
)
|
|
37
|
+
pipeline_tag: Optional[StrictStr] = Field(
|
|
38
|
+
default=None,
|
|
39
|
+
description="+label=Pipeline Tag +usage=Pipeline tag +docs=Pipeline tag for the framework",
|
|
40
|
+
)
|
|
41
|
+
__properties = ["type", "library_name", "pipeline_tag"]
|
|
42
|
+
|
|
43
|
+
@validator("type")
|
|
44
|
+
def type_validate_enum(cls, value):
|
|
45
|
+
"""Validates the enum"""
|
|
46
|
+
if value not in ("transformers"):
|
|
47
|
+
raise ValueError("must be one of enum values ('transformers')")
|
|
48
|
+
return value
|
|
49
|
+
|
|
50
|
+
class Config:
|
|
51
|
+
"""Pydantic configuration"""
|
|
52
|
+
|
|
53
|
+
allow_population_by_field_name = True
|
|
54
|
+
validate_assignment = True
|
|
55
|
+
|
|
56
|
+
def to_str(self) -> str:
|
|
57
|
+
"""Returns the string representation of the model using alias"""
|
|
58
|
+
return pprint.pformat(self.dict(by_alias=True))
|
|
59
|
+
|
|
60
|
+
def to_json(self) -> str:
|
|
61
|
+
"""Returns the JSON representation of the model using alias"""
|
|
62
|
+
return json.dumps(self.to_dict())
|
|
63
|
+
|
|
64
|
+
@classmethod
|
|
65
|
+
def from_json(cls, json_str: str) -> TransformersFramework:
|
|
66
|
+
"""Create an instance of TransformersFramework from a JSON string"""
|
|
67
|
+
return cls.from_dict(json.loads(json_str))
|
|
68
|
+
|
|
69
|
+
def to_dict(self):
|
|
70
|
+
"""Returns the dictionary representation of the model using alias"""
|
|
71
|
+
_dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
|
|
72
|
+
return _dict
|
|
73
|
+
|
|
74
|
+
@classmethod
|
|
75
|
+
def from_dict(cls, obj: dict) -> TransformersFramework:
|
|
76
|
+
"""Create an instance of TransformersFramework from a dict"""
|
|
77
|
+
if obj is None:
|
|
78
|
+
return None
|
|
79
|
+
|
|
80
|
+
if not isinstance(obj, dict):
|
|
81
|
+
return TransformersFramework.parse_obj(obj)
|
|
82
|
+
|
|
83
|
+
_obj = TransformersFramework.parse_obj(
|
|
84
|
+
{
|
|
85
|
+
"type": obj.get("type"),
|
|
86
|
+
"library_name": obj.get("library_name"),
|
|
87
|
+
"pipeline_tag": obj.get("pipeline_tag"),
|
|
88
|
+
}
|
|
89
|
+
)
|
|
90
|
+
return _obj
|
|
@@ -0,0 +1,79 @@
|
|
|
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 TruefoundryModelSource(BaseModel):
|
|
24
|
+
"""
|
|
25
|
+
+docs=Describes the source for the Model +usage=Source for the Model +label=Model Source # noqa: E501
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
type: StrictStr = Field(
|
|
29
|
+
default=..., description="+label=Type +usage=Type of the source"
|
|
30
|
+
)
|
|
31
|
+
uri: StrictStr = Field(
|
|
32
|
+
default=..., description="+label=URI +usage=URI of the model source"
|
|
33
|
+
)
|
|
34
|
+
__properties = ["type", "uri"]
|
|
35
|
+
|
|
36
|
+
@validator("type")
|
|
37
|
+
def type_validate_enum(cls, value):
|
|
38
|
+
"""Validates the enum"""
|
|
39
|
+
if value not in ("truefoundry"):
|
|
40
|
+
raise ValueError("must be one of enum values ('truefoundry')")
|
|
41
|
+
return value
|
|
42
|
+
|
|
43
|
+
class Config:
|
|
44
|
+
"""Pydantic configuration"""
|
|
45
|
+
|
|
46
|
+
allow_population_by_field_name = True
|
|
47
|
+
validate_assignment = True
|
|
48
|
+
|
|
49
|
+
def to_str(self) -> str:
|
|
50
|
+
"""Returns the string representation of the model using alias"""
|
|
51
|
+
return pprint.pformat(self.dict(by_alias=True))
|
|
52
|
+
|
|
53
|
+
def to_json(self) -> str:
|
|
54
|
+
"""Returns the JSON representation of the model using alias"""
|
|
55
|
+
return json.dumps(self.to_dict())
|
|
56
|
+
|
|
57
|
+
@classmethod
|
|
58
|
+
def from_json(cls, json_str: str) -> TruefoundryModelSource:
|
|
59
|
+
"""Create an instance of TruefoundryModelSource from a JSON string"""
|
|
60
|
+
return cls.from_dict(json.loads(json_str))
|
|
61
|
+
|
|
62
|
+
def to_dict(self):
|
|
63
|
+
"""Returns the dictionary representation of the model using alias"""
|
|
64
|
+
_dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
|
|
65
|
+
return _dict
|
|
66
|
+
|
|
67
|
+
@classmethod
|
|
68
|
+
def from_dict(cls, obj: dict) -> TruefoundryModelSource:
|
|
69
|
+
"""Create an instance of TruefoundryModelSource from a dict"""
|
|
70
|
+
if obj is None:
|
|
71
|
+
return None
|
|
72
|
+
|
|
73
|
+
if not isinstance(obj, dict):
|
|
74
|
+
return TruefoundryModelSource.parse_obj(obj)
|
|
75
|
+
|
|
76
|
+
_obj = TruefoundryModelSource.parse_obj(
|
|
77
|
+
{"type": obj.get("type"), "uri": obj.get("uri")}
|
|
78
|
+
)
|
|
79
|
+
return _obj
|
|
@@ -19,6 +19,9 @@ import re # noqa: F401
|
|
|
19
19
|
from typing import Any, Dict, Optional
|
|
20
20
|
|
|
21
21
|
from truefoundry.ml.autogen.client.models.model_schema_dto import ModelSchemaDto
|
|
22
|
+
from truefoundry.ml.autogen.client.models.model_version_manifest import (
|
|
23
|
+
ModelVersionManifest,
|
|
24
|
+
)
|
|
22
25
|
from truefoundry.pydantic_v1 import BaseModel, Field, StrictBool, StrictStr
|
|
23
26
|
|
|
24
27
|
|
|
@@ -33,6 +36,7 @@ class UpdateModelVersionRequestDto(BaseModel):
|
|
|
33
36
|
model_schema: Optional[ModelSchemaDto] = None
|
|
34
37
|
monitoring_enabled: Optional[StrictBool] = None
|
|
35
38
|
model_framework: Optional[StrictStr] = None
|
|
39
|
+
manifest: Optional[ModelVersionManifest] = None
|
|
36
40
|
__properties = [
|
|
37
41
|
"id",
|
|
38
42
|
"description",
|
|
@@ -40,6 +44,7 @@ class UpdateModelVersionRequestDto(BaseModel):
|
|
|
40
44
|
"model_schema",
|
|
41
45
|
"monitoring_enabled",
|
|
42
46
|
"model_framework",
|
|
47
|
+
"manifest",
|
|
43
48
|
]
|
|
44
49
|
|
|
45
50
|
class Config:
|
|
@@ -67,6 +72,9 @@ class UpdateModelVersionRequestDto(BaseModel):
|
|
|
67
72
|
# override the default output from truefoundry.pydantic_v1 by calling `to_dict()` of model_schema
|
|
68
73
|
if self.model_schema:
|
|
69
74
|
_dict["model_schema"] = self.model_schema.to_dict()
|
|
75
|
+
# override the default output from truefoundry.pydantic_v1 by calling `to_dict()` of manifest
|
|
76
|
+
if self.manifest:
|
|
77
|
+
_dict["manifest"] = self.manifest.to_dict()
|
|
70
78
|
return _dict
|
|
71
79
|
|
|
72
80
|
@classmethod
|
|
@@ -88,6 +96,9 @@ class UpdateModelVersionRequestDto(BaseModel):
|
|
|
88
96
|
else None,
|
|
89
97
|
"monitoring_enabled": obj.get("monitoring_enabled"),
|
|
90
98
|
"model_framework": obj.get("model_framework"),
|
|
99
|
+
"manifest": ModelVersionManifest.from_dict(obj.get("manifest"))
|
|
100
|
+
if obj.get("manifest") is not None
|
|
101
|
+
else None,
|
|
91
102
|
}
|
|
92
103
|
)
|
|
93
104
|
return _obj
|
|
@@ -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 UploadModelSource(BaseModel):
|
|
24
|
+
"""
|
|
25
|
+
UploadModelSource
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
type: StrictStr = Field(
|
|
29
|
+
default=..., description="+label=Type +usage=Type of the source"
|
|
30
|
+
)
|
|
31
|
+
__properties = ["type"]
|
|
32
|
+
|
|
33
|
+
@validator("type")
|
|
34
|
+
def type_validate_enum(cls, value):
|
|
35
|
+
"""Validates the enum"""
|
|
36
|
+
if value not in ("upload"):
|
|
37
|
+
raise ValueError("must be one of enum values ('upload')")
|
|
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) -> UploadModelSource:
|
|
56
|
+
"""Create an instance of UploadModelSource 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) -> UploadModelSource:
|
|
66
|
+
"""Create an instance of UploadModelSource from a dict"""
|
|
67
|
+
if obj is None:
|
|
68
|
+
return None
|
|
69
|
+
|
|
70
|
+
if not isinstance(obj, dict):
|
|
71
|
+
return UploadModelSource.parse_obj(obj)
|
|
72
|
+
|
|
73
|
+
_obj = UploadModelSource.parse_obj({"type": obj.get("type")})
|
|
74
|
+
return _obj
|