truefoundry 0.5.1rc1__py3-none-any.whl → 0.5.1rc3__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/__init__.py +9 -2
- truefoundry/ml/autogen/client/__init__.py +4 -0
- truefoundry/ml/autogen/client/models/__init__.py +4 -0
- truefoundry/ml/autogen/client/models/infer_method_name.py +1 -1
- truefoundry/ml/autogen/client/models/model_version_manifest.py +0 -6
- truefoundry/ml/autogen/client/models/sklearn_framework.py +12 -15
- truefoundry/ml/autogen/client/models/sklearn_model_schema.py +82 -0
- truefoundry/ml/autogen/client/models/xg_boost_framework.py +11 -1
- truefoundry/ml/autogen/client/models/xg_boost_model_schema.py +82 -0
- truefoundry/ml/autogen/client_README.md +2 -0
- truefoundry/ml/autogen/entities/artifacts.py +70 -49
- truefoundry/ml/log_types/artifacts/model.py +18 -25
- truefoundry/ml/mlfoundry_api.py +0 -2
- truefoundry/ml/mlfoundry_run.py +0 -2
- {truefoundry-0.5.1rc1.dist-info → truefoundry-0.5.1rc3.dist-info}/METADATA +1 -1
- {truefoundry-0.5.1rc1.dist-info → truefoundry-0.5.1rc3.dist-info}/RECORD +18 -17
- truefoundry/ml/log_types/artifacts/model_extras.py +0 -48
- {truefoundry-0.5.1rc1.dist-info → truefoundry-0.5.1rc3.dist-info}/WHEEL +0 -0
- {truefoundry-0.5.1rc1.dist-info → truefoundry-0.5.1rc3.dist-info}/entry_points.txt +0 -0
truefoundry/ml/__init__.py
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
from truefoundry.ml.autogen.client.models import
|
|
2
|
-
|
|
1
|
+
from truefoundry.ml.autogen.client.models import (
|
|
2
|
+
LibraryName,
|
|
3
|
+
ModelVersionEnvironment,
|
|
4
|
+
SklearnModelSchema,
|
|
5
|
+
XGBoostModelSchema,
|
|
6
|
+
)
|
|
3
7
|
from truefoundry.ml.enums import (
|
|
4
8
|
DataSlice,
|
|
5
9
|
FileFormat,
|
|
@@ -17,6 +21,7 @@ from truefoundry.ml.log_types.artifacts.artifact import (
|
|
|
17
21
|
from truefoundry.ml.log_types.artifacts.dataset import DataDirectory, DataDirectoryPath
|
|
18
22
|
from truefoundry.ml.log_types.artifacts.model import (
|
|
19
23
|
ModelVersion,
|
|
24
|
+
infer_signature,
|
|
20
25
|
)
|
|
21
26
|
from truefoundry.ml.logger import init_logger
|
|
22
27
|
from truefoundry.ml.mlfoundry_api import get_client
|
|
@@ -66,12 +71,14 @@ __all__ = [
|
|
|
66
71
|
"Plot",
|
|
67
72
|
"PyTorchFramework",
|
|
68
73
|
"SklearnFramework",
|
|
74
|
+
"SklearnModelSchema",
|
|
69
75
|
"SpaCyFramework",
|
|
70
76
|
"StatsModelsFramework",
|
|
71
77
|
"TensorFlowFramework",
|
|
72
78
|
"TransformersFramework",
|
|
73
79
|
"ViewType",
|
|
74
80
|
"XGBoostFramework",
|
|
81
|
+
"XGBoostModelSchema",
|
|
75
82
|
"get_client",
|
|
76
83
|
"infer_signature",
|
|
77
84
|
]
|
|
@@ -372,6 +372,7 @@ from truefoundry.ml.autogen.client.models.set_experiment_tag_request_dto import
|
|
|
372
372
|
from truefoundry.ml.autogen.client.models.set_tag_request_dto import SetTagRequestDto
|
|
373
373
|
from truefoundry.ml.autogen.client.models.signed_url_dto import SignedURLDto
|
|
374
374
|
from truefoundry.ml.autogen.client.models.sklearn_framework import SklearnFramework
|
|
375
|
+
from truefoundry.ml.autogen.client.models.sklearn_model_schema import SklearnModelSchema
|
|
375
376
|
from truefoundry.ml.autogen.client.models.source import Source
|
|
376
377
|
from truefoundry.ml.autogen.client.models.source1 import Source1
|
|
377
378
|
from truefoundry.ml.autogen.client.models.spa_cy_framework import SpaCyFramework
|
|
@@ -427,3 +428,6 @@ from truefoundry.ml.autogen.client.models.validation_error_loc_inner import (
|
|
|
427
428
|
ValidationErrorLocInner,
|
|
428
429
|
)
|
|
429
430
|
from truefoundry.ml.autogen.client.models.xg_boost_framework import XGBoostFramework
|
|
431
|
+
from truefoundry.ml.autogen.client.models.xg_boost_model_schema import (
|
|
432
|
+
XGBoostModelSchema,
|
|
433
|
+
)
|
|
@@ -343,6 +343,7 @@ from truefoundry.ml.autogen.client.models.set_experiment_tag_request_dto import
|
|
|
343
343
|
from truefoundry.ml.autogen.client.models.set_tag_request_dto import SetTagRequestDto
|
|
344
344
|
from truefoundry.ml.autogen.client.models.signed_url_dto import SignedURLDto
|
|
345
345
|
from truefoundry.ml.autogen.client.models.sklearn_framework import SklearnFramework
|
|
346
|
+
from truefoundry.ml.autogen.client.models.sklearn_model_schema import SklearnModelSchema
|
|
346
347
|
from truefoundry.ml.autogen.client.models.source import Source
|
|
347
348
|
from truefoundry.ml.autogen.client.models.source1 import Source1
|
|
348
349
|
from truefoundry.ml.autogen.client.models.spa_cy_framework import SpaCyFramework
|
|
@@ -398,3 +399,6 @@ from truefoundry.ml.autogen.client.models.validation_error_loc_inner import (
|
|
|
398
399
|
ValidationErrorLocInner,
|
|
399
400
|
)
|
|
400
401
|
from truefoundry.ml.autogen.client.models.xg_boost_framework import XGBoostFramework
|
|
402
|
+
from truefoundry.ml.autogen.client.models.xg_boost_model_schema import (
|
|
403
|
+
XGBoostModelSchema,
|
|
404
|
+
)
|
|
@@ -53,10 +53,6 @@ class ModelVersionManifest(BaseModel):
|
|
|
53
53
|
step: Optional[conint(strict=True, ge=0)] = Field(
|
|
54
54
|
default=0, description="+label=Step"
|
|
55
55
|
)
|
|
56
|
-
model_schema: Optional[Dict[str, Any]] = Field(
|
|
57
|
-
default=None,
|
|
58
|
-
description="+label=Model Schema +usage=Schema of the model +uiType=JsonInput",
|
|
59
|
-
)
|
|
60
56
|
__properties = [
|
|
61
57
|
"description",
|
|
62
58
|
"metadata",
|
|
@@ -65,7 +61,6 @@ class ModelVersionManifest(BaseModel):
|
|
|
65
61
|
"framework",
|
|
66
62
|
"environment",
|
|
67
63
|
"step",
|
|
68
|
-
"model_schema",
|
|
69
64
|
]
|
|
70
65
|
|
|
71
66
|
@validator("type")
|
|
@@ -137,7 +132,6 @@ class ModelVersionManifest(BaseModel):
|
|
|
137
132
|
if obj.get("environment") is not None
|
|
138
133
|
else None,
|
|
139
134
|
"step": obj.get("step") if obj.get("step") is not None else 0,
|
|
140
|
-
"model_schema": obj.get("model_schema"),
|
|
141
135
|
}
|
|
142
136
|
)
|
|
143
137
|
return _obj
|
|
@@ -18,10 +18,10 @@ import pprint
|
|
|
18
18
|
import re # noqa: F401
|
|
19
19
|
from typing import Optional
|
|
20
20
|
|
|
21
|
-
from truefoundry.ml.autogen.client.models.infer_method_name import InferMethodName
|
|
22
21
|
from truefoundry.ml.autogen.client.models.serialization_format import (
|
|
23
22
|
SerializationFormat,
|
|
24
23
|
)
|
|
24
|
+
from truefoundry.ml.autogen.client.models.sklearn_model_schema import SklearnModelSchema
|
|
25
25
|
from truefoundry.pydantic_v1 import BaseModel, Field, StrictStr, validator
|
|
26
26
|
|
|
27
27
|
|
|
@@ -34,24 +34,16 @@ class SklearnFramework(BaseModel):
|
|
|
34
34
|
default=...,
|
|
35
35
|
description="+label=Type +usage=Type of the framework +value=sklearn",
|
|
36
36
|
)
|
|
37
|
-
serialization_format: Optional[SerializationFormat] = Field(
|
|
38
|
-
default=None,
|
|
39
|
-
description="+label=Serialization format +usage=Serialization format used for the model",
|
|
40
|
-
)
|
|
41
37
|
model_filepath: Optional[StrictStr] = Field(
|
|
42
38
|
default=None,
|
|
43
39
|
description="+label=Model file path +usage=Relative path to the model file",
|
|
44
40
|
)
|
|
45
|
-
|
|
41
|
+
serialization_format: Optional[SerializationFormat] = Field(
|
|
46
42
|
default=None,
|
|
47
|
-
description="+label=
|
|
43
|
+
description="+label=Serialization format +usage=Serialization format used for the model",
|
|
48
44
|
)
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
"serialization_format",
|
|
52
|
-
"model_filepath",
|
|
53
|
-
"infer_method_name",
|
|
54
|
-
]
|
|
45
|
+
model_schema: Optional[SklearnModelSchema] = None
|
|
46
|
+
__properties = ["type", "model_filepath", "serialization_format", "model_schema"]
|
|
55
47
|
|
|
56
48
|
@validator("type")
|
|
57
49
|
def type_validate_enum(cls, value):
|
|
@@ -82,6 +74,9 @@ class SklearnFramework(BaseModel):
|
|
|
82
74
|
def to_dict(self):
|
|
83
75
|
"""Returns the dictionary representation of the model using alias"""
|
|
84
76
|
_dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
|
|
77
|
+
# override the default output from truefoundry.pydantic_v1 by calling `to_dict()` of model_schema
|
|
78
|
+
if self.model_schema:
|
|
79
|
+
_dict["model_schema"] = self.model_schema.to_dict()
|
|
85
80
|
return _dict
|
|
86
81
|
|
|
87
82
|
@classmethod
|
|
@@ -96,9 +91,11 @@ class SklearnFramework(BaseModel):
|
|
|
96
91
|
_obj = SklearnFramework.parse_obj(
|
|
97
92
|
{
|
|
98
93
|
"type": obj.get("type"),
|
|
99
|
-
"serialization_format": obj.get("serialization_format"),
|
|
100
94
|
"model_filepath": obj.get("model_filepath"),
|
|
101
|
-
"
|
|
95
|
+
"serialization_format": obj.get("serialization_format"),
|
|
96
|
+
"model_schema": SklearnModelSchema.from_dict(obj.get("model_schema"))
|
|
97
|
+
if obj.get("model_schema") is not None
|
|
98
|
+
else None,
|
|
102
99
|
}
|
|
103
100
|
)
|
|
104
101
|
return _obj
|
|
@@ -0,0 +1,82 @@
|
|
|
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
|
|
20
|
+
|
|
21
|
+
from truefoundry.ml.autogen.client.models.infer_method_name import InferMethodName
|
|
22
|
+
from truefoundry.pydantic_v1 import BaseModel, Field, conlist
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class SklearnModelSchema(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
SklearnModelSchema
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
infer_method_name: InferMethodName = Field(
|
|
31
|
+
default=...,
|
|
32
|
+
description="+label=Inference Method Name +usage=Name of the method used for inference",
|
|
33
|
+
)
|
|
34
|
+
inputs: conlist(Dict[str, Any]) = Field(
|
|
35
|
+
default=..., description="+label= Input Schema +usage=Schema of the input"
|
|
36
|
+
)
|
|
37
|
+
outputs: conlist(Dict[str, Any]) = Field(
|
|
38
|
+
default=..., description="+label= Output Schema +usage=Schema of the output"
|
|
39
|
+
)
|
|
40
|
+
__properties = ["infer_method_name", "inputs", "outputs"]
|
|
41
|
+
|
|
42
|
+
class Config:
|
|
43
|
+
"""Pydantic configuration"""
|
|
44
|
+
|
|
45
|
+
allow_population_by_field_name = True
|
|
46
|
+
validate_assignment = True
|
|
47
|
+
|
|
48
|
+
def to_str(self) -> str:
|
|
49
|
+
"""Returns the string representation of the model using alias"""
|
|
50
|
+
return pprint.pformat(self.dict(by_alias=True))
|
|
51
|
+
|
|
52
|
+
def to_json(self) -> str:
|
|
53
|
+
"""Returns the JSON representation of the model using alias"""
|
|
54
|
+
return json.dumps(self.to_dict())
|
|
55
|
+
|
|
56
|
+
@classmethod
|
|
57
|
+
def from_json(cls, json_str: str) -> SklearnModelSchema:
|
|
58
|
+
"""Create an instance of SklearnModelSchema from a JSON string"""
|
|
59
|
+
return cls.from_dict(json.loads(json_str))
|
|
60
|
+
|
|
61
|
+
def to_dict(self):
|
|
62
|
+
"""Returns the dictionary representation of the model using alias"""
|
|
63
|
+
_dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
|
|
64
|
+
return _dict
|
|
65
|
+
|
|
66
|
+
@classmethod
|
|
67
|
+
def from_dict(cls, obj: dict) -> SklearnModelSchema:
|
|
68
|
+
"""Create an instance of SklearnModelSchema from a dict"""
|
|
69
|
+
if obj is None:
|
|
70
|
+
return None
|
|
71
|
+
|
|
72
|
+
if not isinstance(obj, dict):
|
|
73
|
+
return SklearnModelSchema.parse_obj(obj)
|
|
74
|
+
|
|
75
|
+
_obj = SklearnModelSchema.parse_obj(
|
|
76
|
+
{
|
|
77
|
+
"infer_method_name": obj.get("infer_method_name"),
|
|
78
|
+
"inputs": obj.get("inputs"),
|
|
79
|
+
"outputs": obj.get("outputs"),
|
|
80
|
+
}
|
|
81
|
+
)
|
|
82
|
+
return _obj
|
|
@@ -21,6 +21,9 @@ from typing import Optional
|
|
|
21
21
|
from truefoundry.ml.autogen.client.models.serialization_format import (
|
|
22
22
|
SerializationFormat,
|
|
23
23
|
)
|
|
24
|
+
from truefoundry.ml.autogen.client.models.xg_boost_model_schema import (
|
|
25
|
+
XGBoostModelSchema,
|
|
26
|
+
)
|
|
24
27
|
from truefoundry.pydantic_v1 import BaseModel, Field, StrictStr, validator
|
|
25
28
|
|
|
26
29
|
|
|
@@ -41,7 +44,8 @@ class XGBoostFramework(BaseModel):
|
|
|
41
44
|
default=None,
|
|
42
45
|
description="+label=Model file path +usage=Relative path to the model file",
|
|
43
46
|
)
|
|
44
|
-
|
|
47
|
+
model_schema: Optional[XGBoostModelSchema] = None
|
|
48
|
+
__properties = ["type", "serialization_format", "model_filepath", "model_schema"]
|
|
45
49
|
|
|
46
50
|
@validator("type")
|
|
47
51
|
def type_validate_enum(cls, value):
|
|
@@ -72,6 +76,9 @@ class XGBoostFramework(BaseModel):
|
|
|
72
76
|
def to_dict(self):
|
|
73
77
|
"""Returns the dictionary representation of the model using alias"""
|
|
74
78
|
_dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
|
|
79
|
+
# override the default output from truefoundry.pydantic_v1 by calling `to_dict()` of model_schema
|
|
80
|
+
if self.model_schema:
|
|
81
|
+
_dict["model_schema"] = self.model_schema.to_dict()
|
|
75
82
|
return _dict
|
|
76
83
|
|
|
77
84
|
@classmethod
|
|
@@ -88,6 +95,9 @@ class XGBoostFramework(BaseModel):
|
|
|
88
95
|
"type": obj.get("type"),
|
|
89
96
|
"serialization_format": obj.get("serialization_format"),
|
|
90
97
|
"model_filepath": obj.get("model_filepath"),
|
|
98
|
+
"model_schema": XGBoostModelSchema.from_dict(obj.get("model_schema"))
|
|
99
|
+
if obj.get("model_schema") is not None
|
|
100
|
+
else None,
|
|
91
101
|
}
|
|
92
102
|
)
|
|
93
103
|
return _obj
|
|
@@ -0,0 +1,82 @@
|
|
|
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
|
|
20
|
+
|
|
21
|
+
from truefoundry.ml.autogen.client.models.infer_method_name import InferMethodName
|
|
22
|
+
from truefoundry.pydantic_v1 import BaseModel, Field, conlist
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class XGBoostModelSchema(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
XGBoostModelSchema
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
infer_method_name: InferMethodName = Field(
|
|
31
|
+
default=...,
|
|
32
|
+
description="+label=Inference Method Name +usage=Name of the method used for inference",
|
|
33
|
+
)
|
|
34
|
+
inputs: conlist(Dict[str, Any]) = Field(
|
|
35
|
+
default=..., description="+label= Input Schema +usage=Schema of the input"
|
|
36
|
+
)
|
|
37
|
+
outputs: conlist(Dict[str, Any]) = Field(
|
|
38
|
+
default=..., description="+label= Output Schema +usage=Schema of the output"
|
|
39
|
+
)
|
|
40
|
+
__properties = ["infer_method_name", "inputs", "outputs"]
|
|
41
|
+
|
|
42
|
+
class Config:
|
|
43
|
+
"""Pydantic configuration"""
|
|
44
|
+
|
|
45
|
+
allow_population_by_field_name = True
|
|
46
|
+
validate_assignment = True
|
|
47
|
+
|
|
48
|
+
def to_str(self) -> str:
|
|
49
|
+
"""Returns the string representation of the model using alias"""
|
|
50
|
+
return pprint.pformat(self.dict(by_alias=True))
|
|
51
|
+
|
|
52
|
+
def to_json(self) -> str:
|
|
53
|
+
"""Returns the JSON representation of the model using alias"""
|
|
54
|
+
return json.dumps(self.to_dict())
|
|
55
|
+
|
|
56
|
+
@classmethod
|
|
57
|
+
def from_json(cls, json_str: str) -> XGBoostModelSchema:
|
|
58
|
+
"""Create an instance of XGBoostModelSchema from a JSON string"""
|
|
59
|
+
return cls.from_dict(json.loads(json_str))
|
|
60
|
+
|
|
61
|
+
def to_dict(self):
|
|
62
|
+
"""Returns the dictionary representation of the model using alias"""
|
|
63
|
+
_dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
|
|
64
|
+
return _dict
|
|
65
|
+
|
|
66
|
+
@classmethod
|
|
67
|
+
def from_dict(cls, obj: dict) -> XGBoostModelSchema:
|
|
68
|
+
"""Create an instance of XGBoostModelSchema from a dict"""
|
|
69
|
+
if obj is None:
|
|
70
|
+
return None
|
|
71
|
+
|
|
72
|
+
if not isinstance(obj, dict):
|
|
73
|
+
return XGBoostModelSchema.parse_obj(obj)
|
|
74
|
+
|
|
75
|
+
_obj = XGBoostModelSchema.parse_obj(
|
|
76
|
+
{
|
|
77
|
+
"infer_method_name": obj.get("infer_method_name"),
|
|
78
|
+
"inputs": obj.get("inputs"),
|
|
79
|
+
"outputs": obj.get("outputs"),
|
|
80
|
+
}
|
|
81
|
+
)
|
|
82
|
+
return _obj
|
|
@@ -304,6 +304,7 @@ Class | Method | HTTP request | Description
|
|
|
304
304
|
- [SetTagRequestDto](truefoundry/ml/autogen/client/docs/SetTagRequestDto.md)
|
|
305
305
|
- [SignedURLDto](truefoundry/ml/autogen/client/docs/SignedURLDto.md)
|
|
306
306
|
- [SklearnFramework](truefoundry/ml/autogen/client/docs/SklearnFramework.md)
|
|
307
|
+
- [SklearnModelSchema](truefoundry/ml/autogen/client/docs/SklearnModelSchema.md)
|
|
307
308
|
- [Source](truefoundry/ml/autogen/client/docs/Source.md)
|
|
308
309
|
- [Source1](truefoundry/ml/autogen/client/docs/Source1.md)
|
|
309
310
|
- [SpaCyFramework](truefoundry/ml/autogen/client/docs/SpaCyFramework.md)
|
|
@@ -331,6 +332,7 @@ Class | Method | HTTP request | Description
|
|
|
331
332
|
- [ValidationError](truefoundry/ml/autogen/client/docs/ValidationError.md)
|
|
332
333
|
- [ValidationErrorLocInner](truefoundry/ml/autogen/client/docs/ValidationErrorLocInner.md)
|
|
333
334
|
- [XGBoostFramework](truefoundry/ml/autogen/client/docs/XGBoostFramework.md)
|
|
335
|
+
- [XGBoostModelSchema](truefoundry/ml/autogen/client/docs/XGBoostModelSchema.md)
|
|
334
336
|
|
|
335
337
|
|
|
336
338
|
<a id="documentation-for-authorization"></a>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# generated by datamodel-codegen:
|
|
2
2
|
# filename: artifacts.json
|
|
3
|
-
# timestamp: 2024-12-
|
|
3
|
+
# timestamp: 2024-12-05T14:45:34+00:00
|
|
4
4
|
|
|
5
5
|
from __future__ import annotations
|
|
6
6
|
|
|
@@ -60,6 +60,19 @@ class BaseArtifactVersion(BaseModel):
|
|
|
60
60
|
)
|
|
61
61
|
|
|
62
62
|
|
|
63
|
+
class BaseModelSchema(BaseModel):
|
|
64
|
+
infer_method_name: str = Field(
|
|
65
|
+
...,
|
|
66
|
+
description="+label=Inference Method Name\n+usage=Name of the method used for inference",
|
|
67
|
+
)
|
|
68
|
+
inputs: List[Dict[str, Any]] = Field(
|
|
69
|
+
..., description="+label= Input Schema\n+usage=Schema of the input"
|
|
70
|
+
)
|
|
71
|
+
outputs: List[Dict[str, Any]] = Field(
|
|
72
|
+
..., description="+label= Output Schema\n+usage=Schema of the output"
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
|
|
63
76
|
class MimeType(str, Enum):
|
|
64
77
|
"""
|
|
65
78
|
+label=MIME Type
|
|
@@ -289,7 +302,7 @@ class SerializationFormat(str, Enum):
|
|
|
289
302
|
|
|
290
303
|
class InferMethodName(str, Enum):
|
|
291
304
|
"""
|
|
292
|
-
+label=Inference
|
|
305
|
+
+label=Inference Method Name
|
|
293
306
|
+usage=Name of the method used for inference
|
|
294
307
|
"""
|
|
295
308
|
|
|
@@ -297,26 +310,10 @@ class InferMethodName(str, Enum):
|
|
|
297
310
|
predict_proba = "predict_proba"
|
|
298
311
|
|
|
299
312
|
|
|
300
|
-
class
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
"""
|
|
305
|
-
|
|
306
|
-
type: Literal["sklearn"] = Field(
|
|
307
|
-
..., description="+label=Type\n+usage=Type of the framework\n+value=sklearn"
|
|
308
|
-
)
|
|
309
|
-
serialization_format: Optional[SerializationFormat] = Field(
|
|
310
|
-
None,
|
|
311
|
-
description="+label=Serialization format\n+usage=Serialization format used for the model",
|
|
312
|
-
)
|
|
313
|
-
model_filepath: Optional[str] = Field(
|
|
314
|
-
None,
|
|
315
|
-
description="+label=Model file path\n+usage=Relative path to the model file",
|
|
316
|
-
)
|
|
317
|
-
infer_method_name: Optional[InferMethodName] = Field(
|
|
318
|
-
None,
|
|
319
|
-
description="+label=Inference method name\n+usage=Name of the method used for inference",
|
|
313
|
+
class SklearnModelSchema(BaseModelSchema):
|
|
314
|
+
infer_method_name: InferMethodName = Field(
|
|
315
|
+
...,
|
|
316
|
+
description="+label=Inference Method Name\n+usage=Name of the method used for inference",
|
|
320
317
|
)
|
|
321
318
|
|
|
322
319
|
|
|
@@ -451,22 +448,10 @@ class UserMessage(BaseModel):
|
|
|
451
448
|
)
|
|
452
449
|
|
|
453
450
|
|
|
454
|
-
class
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
"""
|
|
459
|
-
|
|
460
|
-
type: Literal["xgboost"] = Field(
|
|
461
|
-
..., description="+label=Type\n+usage=Type of the framework\n+value=xgboost"
|
|
462
|
-
)
|
|
463
|
-
serialization_format: Optional[SerializationFormat] = Field(
|
|
464
|
-
None,
|
|
465
|
-
description="+label=Serialization format\n+usage=Serialization format used for the model",
|
|
466
|
-
)
|
|
467
|
-
model_filepath: Optional[str] = Field(
|
|
468
|
-
None,
|
|
469
|
-
description="+label=Model file path\n+usage=Relative path to the model file",
|
|
451
|
+
class XGBoostModelSchema(BaseModelSchema):
|
|
452
|
+
infer_method_name: InferMethodName = Field(
|
|
453
|
+
...,
|
|
454
|
+
description="+label=Inference Method Name\n+usage=Name of the method used for inference",
|
|
470
455
|
)
|
|
471
456
|
|
|
472
457
|
|
|
@@ -563,6 +548,53 @@ class ChatPrompt(BasePrompt):
|
|
|
563
548
|
)
|
|
564
549
|
|
|
565
550
|
|
|
551
|
+
class SklearnFramework(BaseModel):
|
|
552
|
+
"""
|
|
553
|
+
+docs=Scikit-learn framework for the model version
|
|
554
|
+
+label=Sklearn
|
|
555
|
+
"""
|
|
556
|
+
|
|
557
|
+
type: Literal["sklearn"] = Field(
|
|
558
|
+
..., description="+label=Type\n+usage=Type of the framework\n+value=sklearn"
|
|
559
|
+
)
|
|
560
|
+
model_filepath: Optional[str] = Field(
|
|
561
|
+
None,
|
|
562
|
+
description="+label=Model file path\n+usage=Relative path to the model file",
|
|
563
|
+
)
|
|
564
|
+
serialization_format: Optional[SerializationFormat] = Field(
|
|
565
|
+
None,
|
|
566
|
+
description="+label=Serialization format\n+usage=Serialization format used for the model",
|
|
567
|
+
)
|
|
568
|
+
model_schema: Optional[SklearnModelSchema] = None
|
|
569
|
+
|
|
570
|
+
|
|
571
|
+
class XGBoostFramework(BaseModel):
|
|
572
|
+
"""
|
|
573
|
+
+docs=XGBoost framework for the model version
|
|
574
|
+
+label=XGBoost
|
|
575
|
+
"""
|
|
576
|
+
|
|
577
|
+
type: Literal["xgboost"] = Field(
|
|
578
|
+
..., description="+label=Type\n+usage=Type of the framework\n+value=xgboost"
|
|
579
|
+
)
|
|
580
|
+
serialization_format: Optional[SerializationFormat] = Field(
|
|
581
|
+
None,
|
|
582
|
+
description="+label=Serialization format\n+usage=Serialization format used for the model",
|
|
583
|
+
)
|
|
584
|
+
model_filepath: Optional[str] = Field(
|
|
585
|
+
None,
|
|
586
|
+
description="+label=Model file path\n+usage=Relative path to the model file",
|
|
587
|
+
)
|
|
588
|
+
model_schema: Optional[XGBoostModelSchema] = None
|
|
589
|
+
|
|
590
|
+
|
|
591
|
+
class AgentApp(BaseModel):
|
|
592
|
+
type: Literal["agent-app"] = Field(..., description="+value=agent-app")
|
|
593
|
+
tools: List[AgentOpenAPIToolWithFQN]
|
|
594
|
+
agents: List[AgentWithFQN]
|
|
595
|
+
root_agent: constr(min_length=1)
|
|
596
|
+
|
|
597
|
+
|
|
566
598
|
class ModelVersion(BaseArtifactVersion):
|
|
567
599
|
type: Literal["model-version"] = Field(
|
|
568
600
|
..., description='+label=Type\n+usage=Model Version\n+value="model-version"'
|
|
@@ -593,17 +625,6 @@ class ModelVersion(BaseArtifactVersion):
|
|
|
593
625
|
)
|
|
594
626
|
environment: Optional[ModelVersionEnvironment] = None
|
|
595
627
|
step: conint(ge=0) = Field(0, description="+label=Step")
|
|
596
|
-
model_schema: Optional[Dict[str, Any]] = Field(
|
|
597
|
-
None,
|
|
598
|
-
description="+label=Model Schema\n+usage=Schema of the model\n+uiType=JsonInput",
|
|
599
|
-
)
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
class AgentApp(BaseModel):
|
|
603
|
-
type: Literal["agent-app"] = Field(..., description="+value=agent-app")
|
|
604
|
-
tools: List[AgentOpenAPIToolWithFQN]
|
|
605
|
-
agents: List[AgentWithFQN]
|
|
606
|
-
root_agent: constr(min_length=1)
|
|
607
628
|
|
|
608
629
|
|
|
609
630
|
class VersionedArtifactType(BaseModel):
|
|
@@ -54,6 +54,9 @@ from truefoundry.ml.session import _get_api_client
|
|
|
54
54
|
from truefoundry.pydantic_v1 import BaseModel, Extra
|
|
55
55
|
|
|
56
56
|
if TYPE_CHECKING:
|
|
57
|
+
import numpy as np
|
|
58
|
+
import pandas as pd
|
|
59
|
+
|
|
57
60
|
from truefoundry.ml.mlfoundry_run import MlFoundryRun
|
|
58
61
|
|
|
59
62
|
|
|
@@ -102,7 +105,6 @@ class ModelVersion:
|
|
|
102
105
|
self._deleted = False
|
|
103
106
|
self._description: str = ""
|
|
104
107
|
self._metadata: Dict[str, Any] = {}
|
|
105
|
-
self._model_schema: Optional[Dict[str, Any]] = None
|
|
106
108
|
self._environment: Optional[ModelVersionEnvironment] = None
|
|
107
109
|
self._framework: Optional[ModelFrameworkType] = None
|
|
108
110
|
self._set_mutable_attrs()
|
|
@@ -146,9 +148,6 @@ class ModelVersion:
|
|
|
146
148
|
if self._model_version.manifest:
|
|
147
149
|
self._description = self._model_version.manifest.description or ""
|
|
148
150
|
self._metadata = copy.deepcopy(self._model_version.manifest.metadata)
|
|
149
|
-
self._model_schema = copy.deepcopy(
|
|
150
|
-
self._model_version.manifest.model_schema
|
|
151
|
-
)
|
|
152
151
|
self._environment = copy.deepcopy(self._model_version.manifest.environment)
|
|
153
152
|
self._framework = (
|
|
154
153
|
copy.deepcopy(self._model_version.manifest.framework.actual_instance)
|
|
@@ -158,7 +157,6 @@ class ModelVersion:
|
|
|
158
157
|
else:
|
|
159
158
|
self._description = self._model_version.description or ""
|
|
160
159
|
self._metadata = copy.deepcopy(self._model_version.artifact_metadata)
|
|
161
|
-
self._model_schema = None
|
|
162
160
|
self._environment = None
|
|
163
161
|
self._framework = _ModelFramework.to_model_framework_type(
|
|
164
162
|
self._model_version.model_framework
|
|
@@ -232,23 +230,6 @@ class ModelVersion:
|
|
|
232
230
|
_validate_artifact_metadata(value)
|
|
233
231
|
self._metadata = copy.deepcopy(value)
|
|
234
232
|
|
|
235
|
-
@property
|
|
236
|
-
def model_schema(self) -> Optional[Dict[str, Any]]:
|
|
237
|
-
"""Get model_schema for the current model"""
|
|
238
|
-
return self._model_schema
|
|
239
|
-
|
|
240
|
-
@model_schema.setter
|
|
241
|
-
def model_schema(self, value: Optional[Dict[str, Any]]):
|
|
242
|
-
"""set the model_schema for current model"""
|
|
243
|
-
if not self._model_version.manifest:
|
|
244
|
-
warnings.warn(
|
|
245
|
-
message="This model version was created using an older serialization format. model_schema will not be updated",
|
|
246
|
-
category=DeprecationWarning,
|
|
247
|
-
stacklevel=2,
|
|
248
|
-
)
|
|
249
|
-
return
|
|
250
|
-
self._model_schema = copy.deepcopy(value)
|
|
251
|
-
|
|
252
233
|
@property
|
|
253
234
|
def environment(self) -> Optional[ModelVersionEnvironment]:
|
|
254
235
|
"""Get the environment details for the model"""
|
|
@@ -463,7 +444,6 @@ class ModelVersion:
|
|
|
463
444
|
if self._model_version.manifest:
|
|
464
445
|
self._model_version.manifest.description = self.description
|
|
465
446
|
self._model_version.manifest.metadata = self.metadata
|
|
466
|
-
self._model_version.manifest.model_schema = self.model_schema
|
|
467
447
|
self._model_version.manifest.environment = self.environment
|
|
468
448
|
self._model_version.manifest.framework = (
|
|
469
449
|
Framework.from_dict(self.framework.dict()) if self.framework else None
|
|
@@ -498,7 +478,6 @@ def _log_model_version( # noqa: C901
|
|
|
498
478
|
progress: Optional[bool] = None,
|
|
499
479
|
framework: Optional[Union[str, ModelFramework, "ModelFrameworkType"]] = None,
|
|
500
480
|
environment: Optional[ModelVersionEnvironment] = None,
|
|
501
|
-
model_schema: Optional[Dict[str, Any]] = None,
|
|
502
481
|
) -> ModelVersion:
|
|
503
482
|
if (run and mlfoundry_artifacts_api) or (not run and not mlfoundry_artifacts_api):
|
|
504
483
|
raise MlFoundryException(
|
|
@@ -610,7 +589,6 @@ def _log_model_version( # noqa: C901
|
|
|
610
589
|
framework=Framework.from_dict(framework.dict()) if framework else None,
|
|
611
590
|
environment=environment,
|
|
612
591
|
step=step,
|
|
613
|
-
model_schema=model_schema,
|
|
614
592
|
)
|
|
615
593
|
artifact_version_response = mlfoundry_artifacts_api.finalize_artifact_version_post(
|
|
616
594
|
finalize_artifact_version_request_dto=FinalizeArtifactVersionRequestDto(
|
|
@@ -624,3 +602,18 @@ def _log_model_version( # noqa: C901
|
|
|
624
602
|
)
|
|
625
603
|
)
|
|
626
604
|
return ModelVersion.from_fqn(fqn=artifact_version_response.artifact_version.fqn)
|
|
605
|
+
|
|
606
|
+
|
|
607
|
+
def infer_signature(
|
|
608
|
+
model_input: Any = None,
|
|
609
|
+
model_output: Optional[
|
|
610
|
+
Union["pd.DataFrame", "np.ndarray", Dict[str, "np.ndarray"]]
|
|
611
|
+
] = None,
|
|
612
|
+
params: Optional[Dict[str, Any]] = None,
|
|
613
|
+
):
|
|
614
|
+
# TODO: Importing this globally causes hard dependencies on some libraries like pandas
|
|
615
|
+
from truefoundry.ml.autogen.models import infer_signature as _infer_signature
|
|
616
|
+
|
|
617
|
+
return _infer_signature(
|
|
618
|
+
model_input=model_input, model_output=model_output, params=params
|
|
619
|
+
)
|
truefoundry/ml/mlfoundry_api.py
CHANGED
|
@@ -1265,7 +1265,6 @@ class MlFoundry:
|
|
|
1265
1265
|
progress: Optional[bool] = None,
|
|
1266
1266
|
framework: Optional[Union[str, ModelFramework, "ModelFrameworkType"]] = None,
|
|
1267
1267
|
environment: Optional[ModelVersionEnvironment] = None,
|
|
1268
|
-
model_schema: Optional[Dict[str, Any]] = None,
|
|
1269
1268
|
) -> ModelVersion:
|
|
1270
1269
|
"""
|
|
1271
1270
|
Serialize and log a versioned model under the current ml_repo. Each logged model generates a new version
|
|
@@ -1390,7 +1389,6 @@ class MlFoundry:
|
|
|
1390
1389
|
progress=progress,
|
|
1391
1390
|
framework=framework,
|
|
1392
1391
|
environment=environment,
|
|
1393
|
-
model_schema=model_schema,
|
|
1394
1392
|
)
|
|
1395
1393
|
logger.info(f"Logged model successfully with fqn {model_version.fqn!r}")
|
|
1396
1394
|
return model_version
|
truefoundry/ml/mlfoundry_run.py
CHANGED
|
@@ -934,7 +934,6 @@ class MlFoundryRun:
|
|
|
934
934
|
progress: Optional[bool] = None,
|
|
935
935
|
framework: Optional[Union[str, ModelFramework, "ModelFrameworkType"]] = None,
|
|
936
936
|
environment: Optional[ModelVersionEnvironment] = None,
|
|
937
|
-
model_schema: Optional[Dict[str, Any]] = None,
|
|
938
937
|
) -> ModelVersion:
|
|
939
938
|
# TODO (chiragjn): Document mapping of framework to list of valid model save kwargs
|
|
940
939
|
# TODO (chiragjn): Add more examples
|
|
@@ -1061,7 +1060,6 @@ class MlFoundryRun:
|
|
|
1061
1060
|
progress=progress,
|
|
1062
1061
|
framework=framework,
|
|
1063
1062
|
environment=environment,
|
|
1064
|
-
model_schema=model_schema,
|
|
1065
1063
|
)
|
|
1066
1064
|
logger.info(f"Logged model successfully with fqn {model_version.fqn!r}")
|
|
1067
1065
|
return model_version
|
|
@@ -107,11 +107,11 @@ truefoundry/deploy/v2/lib/models.py,sha256=pSolLMTArDuYpeNsmeeS5DWliloN_iCDfZSpR
|
|
|
107
107
|
truefoundry/deploy/v2/lib/patched_models.py,sha256=NTU8J_CwdvEuF9zNXwFyN3suOp_196Wrm75DDy5qcXE,14184
|
|
108
108
|
truefoundry/deploy/v2/lib/source.py,sha256=VHKuFREiixUP40D3Mrz-TA70spu1M0RbCzl--qwlFaY,9263
|
|
109
109
|
truefoundry/logger.py,sha256=u-YCNjg5HBwE70uQcpjIG64Ghos-K2ulTWaxC03BSj4,714
|
|
110
|
-
truefoundry/ml/__init__.py,sha256=
|
|
110
|
+
truefoundry/ml/__init__.py,sha256=iTuqq6FuVozL0Vyz1B2Xb5PL2LNnXyALXM0S3ehQicQ,2039
|
|
111
111
|
truefoundry/ml/artifact/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
112
112
|
truefoundry/ml/artifact/truefoundry_artifact_repo.py,sha256=FksxhUpRHb9pgWZmAB16DhXqkAL6UIAPA1S3RJUApQU,46201
|
|
113
113
|
truefoundry/ml/autogen/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
114
|
-
truefoundry/ml/autogen/client/__init__.py,sha256=
|
|
114
|
+
truefoundry/ml/autogen/client/__init__.py,sha256=uf2QeBvpQi38iGSPkAmSRki2b8nJIBx-3AnJOo9_mHM,19571
|
|
115
115
|
truefoundry/ml/autogen/client/api/__init__.py,sha256=NyMBxBmIzB1o5LzZZwz9LiydHB3-hPqc_sevsnY6Jrw,746
|
|
116
116
|
truefoundry/ml/autogen/client/api/auth_api.py,sha256=zpWzJhUmW6HHMY_atlUf0B25k77E1kue2hmix5I5Ih0,7017
|
|
117
117
|
truefoundry/ml/autogen/client/api/deprecated_api.py,sha256=mu5x_skNcwz8v1Tr6VP72-tVP7pmBV9muyKy_2NH3F0,38824
|
|
@@ -126,7 +126,7 @@ truefoundry/ml/autogen/client/api_client.py,sha256=M31IycWorn10FYS8WbO_Whaipr0tV
|
|
|
126
126
|
truefoundry/ml/autogen/client/api_response.py,sha256=KRyvecPMXF05PaxILHZ8JHoP4rgKBjKONMgG83aU-rM,844
|
|
127
127
|
truefoundry/ml/autogen/client/configuration.py,sha256=V1oaEnxt-NfpaNmp-EZpf2glovzVhM2coWYt8HBNB4M,15723
|
|
128
128
|
truefoundry/ml/autogen/client/exceptions.py,sha256=XbCbDHhYT3BVejdoGNPgEa4oS56ypkwFdxk1iOc_tFY,5355
|
|
129
|
-
truefoundry/ml/autogen/client/models/__init__.py,sha256=
|
|
129
|
+
truefoundry/ml/autogen/client/models/__init__.py,sha256=iX7kGG97Ly93SQfSwFFbggcXAf2OnO9ubNPl0OhN7W4,18193
|
|
130
130
|
truefoundry/ml/autogen/client/models/add_custom_metrics_to_model_version_request_dto.py,sha256=_ISDspicTGjBCYYXubKfRYYSSQVyW3AvG-jFh47-Zfc,2163
|
|
131
131
|
truefoundry/ml/autogen/client/models/add_features_to_model_version_request_dto.py,sha256=OT1-98DyWNfAHz_EgD2gMX2XkrGQ4Re945fhoAl8qSE,2099
|
|
132
132
|
truefoundry/ml/autogen/client/models/agent.py,sha256=lUAbs092yo9hZmqzX6atKebDNf1uEwTf5jLvjOdvoeM,3872
|
|
@@ -206,7 +206,7 @@ truefoundry/ml/autogen/client/models/h2_o_framework.py,sha256=5X-0Xbt4tpecV_q6Ww
|
|
|
206
206
|
truefoundry/ml/autogen/client/models/http_validation_error.py,sha256=bU-uUlz_qeFba3iHdBT7cHjLu6WZ-JmImYqgZ-kCvxM,2466
|
|
207
207
|
truefoundry/ml/autogen/client/models/image_content_part.py,sha256=m_LE5XqD_UD0f8jtWt0adRgz_FoLEvgZbCDTSYORnCc,2717
|
|
208
208
|
truefoundry/ml/autogen/client/models/image_url.py,sha256=TN8iEdBUmtKdTFlApUodaC4o6X_Ggd3OSOKVPv7laJE,2170
|
|
209
|
-
truefoundry/ml/autogen/client/models/infer_method_name.py,sha256=
|
|
209
|
+
truefoundry/ml/autogen/client/models/infer_method_name.py,sha256=Cpg3aRGrZCG_6JypR0RMvH0cUqRvpMXxr9rabUGxFuY,788
|
|
210
210
|
truefoundry/ml/autogen/client/models/internal_metadata.py,sha256=6OizrIzA3QxlEnwNFXCZGOMJuUDSYHctl_30q27uBDI,6232
|
|
211
211
|
truefoundry/ml/autogen/client/models/keras_framework.py,sha256=sBKDT4Dzkvr3Rf7c8YKRbtzaO_KrPNsW8tdWI_n701Q,2150
|
|
212
212
|
truefoundry/ml/autogen/client/models/latest_run_log_dto.py,sha256=wE8T8bANTb9u14Jv7DNyKWekZiUAvrzvTcE_H1cRhn4,2326
|
|
@@ -247,7 +247,7 @@ truefoundry/ml/autogen/client/models/model_response_dto.py,sha256=osrTxfygkuhxWj
|
|
|
247
247
|
truefoundry/ml/autogen/client/models/model_server.py,sha256=N5mcWmnX0KzTMtTH8A9h_FmiQcMld3B8CXD_UYeDKaA,700
|
|
248
248
|
truefoundry/ml/autogen/client/models/model_version_dto.py,sha256=9Mh4d8V33gEGYr4sys5lYYDA3bHKajR3oAZLZMAy_io,7094
|
|
249
249
|
truefoundry/ml/autogen/client/models/model_version_environment.py,sha256=wTayQjMen24eJCqXQugzoXLANY5NXdVsAvZSh-QIhJA,2827
|
|
250
|
-
truefoundry/ml/autogen/client/models/model_version_manifest.py,sha256=
|
|
250
|
+
truefoundry/ml/autogen/client/models/model_version_manifest.py,sha256=gRsrZzfLm1cHk5cbHmYQtShXGLLxPKcxRMPDWCqWTZc,4657
|
|
251
251
|
truefoundry/ml/autogen/client/models/model_version_response_dto.py,sha256=D6XOCyggxqTkbePuypqYSHYh1PYeDv7R_J32q61sDM0,2320
|
|
252
252
|
truefoundry/ml/autogen/client/models/multi_part_upload_dto.py,sha256=Ckq405vud8RQmMyKCJQJBlW5iXO7Y2mlgo8eVkiMvxg,3738
|
|
253
253
|
truefoundry/ml/autogen/client/models/multi_part_upload_response_dto.py,sha256=VjH0kvl7rMjgDHjYGHnsh7KsZ5-qn-k3ksdGLJ49nIM,2431
|
|
@@ -274,7 +274,8 @@ truefoundry/ml/autogen/client/models/serialization_format.py,sha256=CYq9DR1yipEG
|
|
|
274
274
|
truefoundry/ml/autogen/client/models/set_experiment_tag_request_dto.py,sha256=nrmi_NxLD1fI2gwlpdqFSMnBS11gRkjS4_GQFHgBcXs,2118
|
|
275
275
|
truefoundry/ml/autogen/client/models/set_tag_request_dto.py,sha256=IRgAdMcWBxmjNV6nZJej4pcNfLmZwrelEZ3otwt7eeE,2144
|
|
276
276
|
truefoundry/ml/autogen/client/models/signed_url_dto.py,sha256=9oHoXBj07xTdc04rqOqJO3eOjQWXCyWPhfHg-6qX60w,1897
|
|
277
|
-
truefoundry/ml/autogen/client/models/sklearn_framework.py,sha256=
|
|
277
|
+
truefoundry/ml/autogen/client/models/sklearn_framework.py,sha256=eWpv-CNyxsD9pIBKga568DpQvCn5Nn_GvNMzY1ElRW4,3424
|
|
278
|
+
truefoundry/ml/autogen/client/models/sklearn_model_schema.py,sha256=RJIbkzvIDxkFTyygQLvUfeg7sCrkhwm9Euo7FaNnrLw,2526
|
|
278
279
|
truefoundry/ml/autogen/client/models/source.py,sha256=ZG2-3oIs_M8mZNPjoIRPzhHqlm63vLCVQC9idUxQ0XU,5180
|
|
279
280
|
truefoundry/ml/autogen/client/models/source1.py,sha256=io35b9uVzqSvOHw6RlCXxM30thN-vHm1upaSiN2i0II,5183
|
|
280
281
|
truefoundry/ml/autogen/client/models/spa_cy_framework.py,sha256=Kyrvhdalnl1uQLoPMGMry2PuFGCcQ8AGp4Cx4B9AGXQ,2150
|
|
@@ -301,10 +302,11 @@ truefoundry/ml/autogen/client/models/url.py,sha256=zMyOmdVkp1ANnQnc9GrHt42xlVwES
|
|
|
301
302
|
truefoundry/ml/autogen/client/models/user_message.py,sha256=3TEM8qH_zT3dgM197bl44uV7m20IWn6sWeLGfStsN90,2784
|
|
302
303
|
truefoundry/ml/autogen/client/models/validation_error.py,sha256=mFjwoc8g2-Usu1HXZhOQKQ4TGvLy4lwCzk8dHrJ69aA,2597
|
|
303
304
|
truefoundry/ml/autogen/client/models/validation_error_loc_inner.py,sha256=nThJ5Gmy8W2Wok-ZOI4sK7uRe1BAkLS0qzq-XZbq8zs,4915
|
|
304
|
-
truefoundry/ml/autogen/client/models/xg_boost_framework.py,sha256=
|
|
305
|
+
truefoundry/ml/autogen/client/models/xg_boost_framework.py,sha256=ZTvdmfX5eB_ZbA7Yy62NYAzbYKOQkPtA-zF5xxRnVfE,3429
|
|
306
|
+
truefoundry/ml/autogen/client/models/xg_boost_model_schema.py,sha256=5bzi5NEeR9HetiHFJwwkmeC4LE2WvGF9hp9dTLPfEJ4,2526
|
|
305
307
|
truefoundry/ml/autogen/client/rest.py,sha256=9goba8qHjQuVx5O_yRaTKu7PvBnb7r7swfy3dwuTEgk,14281
|
|
306
|
-
truefoundry/ml/autogen/client_README.md,sha256=
|
|
307
|
-
truefoundry/ml/autogen/entities/artifacts.py,sha256=
|
|
308
|
+
truefoundry/ml/autogen/client_README.md,sha256=8M-8txeNhpwAiXx7z5UEjPYSq2SoqA1EqtCkkKZDCMc,36276
|
|
309
|
+
truefoundry/ml/autogen/entities/artifacts.py,sha256=x3DxHXPS5OpNb1vmuy6p44g2hymq6BXnivFqv6mQ-ds,20113
|
|
308
310
|
truefoundry/ml/autogen/models/__init__.py,sha256=--TGRea9SQBWFfwtcl3ekb1XGfFTdEkQGSG8a2SJ60I,187
|
|
309
311
|
truefoundry/ml/autogen/models/exceptions.py,sha256=q3n7FGBrg_hUy1UyoefhMnhcXUAaqXlLIGHoOVzn_d8,1390
|
|
310
312
|
truefoundry/ml/autogen/models/schema.py,sha256=IhpO9qbygLqEamP3NIt3m90SseJXCOm1ZTqNbNbW-M0,55772
|
|
@@ -331,8 +333,7 @@ truefoundry/ml/log_types/artifacts/artifact.py,sha256=6X4lO23DwM7yTgUOY4RRoYMrf9
|
|
|
331
333
|
truefoundry/ml/log_types/artifacts/constants.py,sha256=qKxQ5mMvJE4j83BvGW3qNTKunxCiBg_EEjTdgbgJtyE,1036
|
|
332
334
|
truefoundry/ml/log_types/artifacts/dataset.py,sha256=a4dxd2EN8p7Ci-cLGGiDOboN3t0395_XhWE1dmTw1Q4,13112
|
|
333
335
|
truefoundry/ml/log_types/artifacts/general_artifact.py,sha256=B4XErLr-m6RmQWtxMTu3wlFRFcqSwPYp6J0OL4Ng6L0,3179
|
|
334
|
-
truefoundry/ml/log_types/artifacts/model.py,sha256=
|
|
335
|
-
truefoundry/ml/log_types/artifacts/model_extras.py,sha256=TIE73bLKfwIVzNiVcjmaZ841A70BHBwu4XAM6ZAQRFI,1045
|
|
336
|
+
truefoundry/ml/log_types/artifacts/model.py,sha256=d2Q-61yXpX1mjXX6t2sL0_xKz-DPA3Z8xYDxzMfUSiA,22820
|
|
336
337
|
truefoundry/ml/log_types/artifacts/utils.py,sha256=yhIZYe3Y-J0rG0Wcwql_Qjxe9hlefFbXUfRFqg4E9cM,7502
|
|
337
338
|
truefoundry/ml/log_types/image/__init__.py,sha256=fcOq8yQnNj1rkLcPeIjLXBpdA1WIeiPsXOlAAvMxx7M,76
|
|
338
339
|
truefoundry/ml/log_types/image/constants.py,sha256=wLtGEOA4T5fZHSlOXPuNDLX3lpbCtwlvGKPFk_1fah0,255
|
|
@@ -343,8 +344,8 @@ truefoundry/ml/log_types/plot.py,sha256=HuYvvRA5r8V0xAIuuqMME2IHb9d3SfGHUiuEkOP3
|
|
|
343
344
|
truefoundry/ml/log_types/pydantic_base.py,sha256=eBlw_AEyAz4iJKDP4zgJOCFWcldwQqpf7FADW1jzIQY,272
|
|
344
345
|
truefoundry/ml/log_types/utils.py,sha256=xjJ21jdPScvFmw3TbVh5NCzbzJwaqiXJyiiT4xxX1EI,335
|
|
345
346
|
truefoundry/ml/logger.py,sha256=VT-BF3BnBYTWVq87O58F0c8uXMu94gYzsiFlGY3_7Ao,458
|
|
346
|
-
truefoundry/ml/mlfoundry_api.py,sha256=
|
|
347
|
-
truefoundry/ml/mlfoundry_run.py,sha256=
|
|
347
|
+
truefoundry/ml/mlfoundry_api.py,sha256=PefznXwBPBv8TD4RYid9aiE8WWEkZQAHoaAbvklFoRs,62364
|
|
348
|
+
truefoundry/ml/mlfoundry_run.py,sha256=RLTZGz3htyxNmG1Xat9WevawEIjDoUCbWrSNql8WynI,44597
|
|
348
349
|
truefoundry/ml/model_framework.py,sha256=2JTQ8m5oqy2FaIBqIEgPeDEfwNBfcQHTw-gdcMXF1pA,15033
|
|
349
350
|
truefoundry/ml/run_utils.py,sha256=0W208wSLUrbdfk2pjNcZlkUi9bNxG2JORqoe-5rVqHI,2423
|
|
350
351
|
truefoundry/ml/session.py,sha256=F83GTC5WwGBjnJ69Ct8MqMnlutYc56JCc6YhEY1Wl-A,5394
|
|
@@ -366,7 +367,7 @@ truefoundry/workflow/remote_filesystem/tfy_signed_url_client.py,sha256=5mBCIc-ON
|
|
|
366
367
|
truefoundry/workflow/remote_filesystem/tfy_signed_url_fs.py,sha256=Hf6Dk6Fu6P7DqsK5ULgraf9DStjgigf-kjaRAMBW-RU,8680
|
|
367
368
|
truefoundry/workflow/task.py,sha256=ToitYiKcNzFCtOVQwz1W8sRjbR97eVS7vQBdbgUQtKg,1779
|
|
368
369
|
truefoundry/workflow/workflow.py,sha256=WaTqUjhwfAXDWu4E5ehuwAxrCbDJkoAf1oWmR2E9Qy0,4575
|
|
369
|
-
truefoundry-0.5.
|
|
370
|
-
truefoundry-0.5.
|
|
371
|
-
truefoundry-0.5.
|
|
372
|
-
truefoundry-0.5.
|
|
370
|
+
truefoundry-0.5.1rc3.dist-info/METADATA,sha256=isGJJmi0DSlh57OQh5ukDKprSYhHxMt59RG1vsjSbhA,2887
|
|
371
|
+
truefoundry-0.5.1rc3.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
|
372
|
+
truefoundry-0.5.1rc3.dist-info/entry_points.txt,sha256=TXvUxQkI6zmqJuycPsyxEIMr3oqfDjgrWj0m_9X12x4,95
|
|
373
|
+
truefoundry-0.5.1rc3.dist-info/RECORD,,
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import enum
|
|
2
|
-
from typing import List, Type, TypeVar
|
|
3
|
-
|
|
4
|
-
from truefoundry.ml.autogen.client import ( # type: ignore[attr-defined]
|
|
5
|
-
ModelSchemaDto,
|
|
6
|
-
)
|
|
7
|
-
from truefoundry.ml.exceptions import MlFoundryException
|
|
8
|
-
from truefoundry.pydantic_v1 import BaseModel
|
|
9
|
-
|
|
10
|
-
T = TypeVar("T")
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
class BaseEnum(enum.Enum):
|
|
14
|
-
@classmethod
|
|
15
|
-
def values(cls: Type[T]) -> List[T]:
|
|
16
|
-
return [member.value for member in cls]
|
|
17
|
-
|
|
18
|
-
@classmethod
|
|
19
|
-
def _missing_(cls: Type[T], value: object):
|
|
20
|
-
raise MlFoundryException(
|
|
21
|
-
f"Unknown value for type {cls.__name__}: {value}", status_code=400
|
|
22
|
-
)
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
@enum.unique
|
|
26
|
-
class CustomMetricValueType(str, BaseEnum):
|
|
27
|
-
FLOAT = "float"
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
@enum.unique
|
|
31
|
-
class CustomMetricType(str, BaseEnum):
|
|
32
|
-
METRIC = "metric"
|
|
33
|
-
PROJECTION = "projection"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
class CustomMetric(BaseModel):
|
|
37
|
-
class Config:
|
|
38
|
-
validate_assignment = True
|
|
39
|
-
use_enum_values = True
|
|
40
|
-
extra = "allow"
|
|
41
|
-
|
|
42
|
-
name: str
|
|
43
|
-
value_type: CustomMetricValueType
|
|
44
|
-
type: CustomMetricType
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
class ModelSchema(ModelSchemaDto):
|
|
48
|
-
pass
|
|
File without changes
|
|
File without changes
|