truefoundry 0.5.0rc7__py3-none-any.whl → 0.5.1__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/common/auth_service_client.py +2 -2
- truefoundry/common/constants.py +9 -0
- truefoundry/common/utils.py +81 -1
- truefoundry/deploy/__init__.py +5 -0
- truefoundry/deploy/builder/builders/tfy_notebook_buildpack/__init__.py +4 -2
- truefoundry/deploy/builder/builders/tfy_python_buildpack/__init__.py +7 -5
- truefoundry/deploy/builder/builders/tfy_python_buildpack/dockerfile_template.py +87 -28
- truefoundry/deploy/builder/constants.py +8 -0
- truefoundry/deploy/builder/utils.py +9 -4
- truefoundry/deploy/cli/cli.py +2 -0
- truefoundry/deploy/cli/commands/__init__.py +1 -0
- truefoundry/deploy/cli/commands/deploy_init_command.py +22 -0
- truefoundry/deploy/lib/dao/application.py +2 -1
- truefoundry/deploy/v2/lib/patched_models.py +8 -0
- truefoundry/ml/__init__.py +25 -16
- truefoundry/ml/autogen/client/__init__.py +21 -3
- truefoundry/ml/autogen/client/api/mlfoundry_artifacts_api.py +325 -0
- truefoundry/ml/autogen/client/models/__init__.py +21 -3
- truefoundry/ml/autogen/client/models/artifact_version_manifest.py +2 -2
- truefoundry/ml/autogen/client/models/export_deployment_files_request_dto.py +82 -0
- truefoundry/ml/autogen/client/models/infer_method_name.py +34 -0
- truefoundry/ml/autogen/client/models/model_server.py +34 -0
- truefoundry/ml/autogen/client/models/model_version_environment.py +1 -1
- truefoundry/ml/autogen/client/models/model_version_manifest.py +2 -8
- truefoundry/ml/autogen/client/models/sklearn_framework.py +15 -5
- truefoundry/ml/autogen/client/models/sklearn_model_schema.py +82 -0
- truefoundry/ml/autogen/client/models/{serialization_format.py → sklearn_serialization_format.py} +5 -5
- truefoundry/ml/autogen/client/models/transformers_framework.py +2 -2
- truefoundry/ml/autogen/client/models/validate_external_storage_root_request_dto.py +71 -0
- truefoundry/ml/autogen/client/models/validate_external_storage_root_response_dto.py +69 -0
- truefoundry/ml/autogen/client/models/xg_boost_framework.py +17 -5
- truefoundry/ml/autogen/client/models/xg_boost_model_schema.py +88 -0
- truefoundry/ml/autogen/client/models/xg_boost_serialization_format.py +36 -0
- truefoundry/ml/autogen/client_README.md +11 -1
- truefoundry/ml/autogen/entities/artifacts.py +95 -39
- truefoundry/ml/autogen/models/signature.py +6 -3
- truefoundry/ml/autogen/models/utils.py +12 -7
- truefoundry/ml/cli/commands/model_init.py +97 -0
- truefoundry/ml/cli/utils.py +34 -0
- truefoundry/ml/log_types/artifacts/model.py +50 -38
- truefoundry/ml/log_types/artifacts/utils.py +38 -2
- truefoundry/ml/mlfoundry_api.py +74 -80
- truefoundry/ml/mlfoundry_run.py +0 -32
- truefoundry/ml/model_framework.py +372 -3
- truefoundry/ml/validation_utils.py +2 -0
- {truefoundry-0.5.0rc7.dist-info → truefoundry-0.5.1.dist-info}/METADATA +1 -5
- {truefoundry-0.5.0rc7.dist-info → truefoundry-0.5.1.dist-info}/RECORD +49 -56
- truefoundry/deploy/function_service/__init__.py +0 -3
- truefoundry/deploy/function_service/__main__.py +0 -27
- truefoundry/deploy/function_service/app.py +0 -92
- truefoundry/deploy/function_service/build.py +0 -45
- truefoundry/deploy/function_service/remote/__init__.py +0 -6
- truefoundry/deploy/function_service/remote/context.py +0 -3
- truefoundry/deploy/function_service/remote/method.py +0 -67
- truefoundry/deploy/function_service/remote/remote.py +0 -144
- truefoundry/deploy/function_service/route.py +0 -137
- truefoundry/deploy/function_service/service.py +0 -113
- truefoundry/deploy/function_service/utils.py +0 -53
- truefoundry/langchain/__init__.py +0 -12
- truefoundry/langchain/deprecated.py +0 -302
- truefoundry/langchain/truefoundry_chat.py +0 -130
- truefoundry/langchain/truefoundry_embeddings.py +0 -171
- truefoundry/langchain/truefoundry_llm.py +0 -106
- truefoundry/langchain/utils.py +0 -44
- truefoundry/ml/log_types/artifacts/model_extras.py +0 -48
- {truefoundry-0.5.0rc7.dist-info → truefoundry-0.5.1.dist-info}/WHEEL +0 -0
- {truefoundry-0.5.0rc7.dist-info → truefoundry-0.5.1.dist-info}/entry_points.txt +0 -0
|
@@ -40,11 +40,11 @@ class ModelVersionManifest(BaseModel):
|
|
|
40
40
|
|
|
41
41
|
description: Optional[constr(strict=True, max_length=512)] = Field(
|
|
42
42
|
default=None,
|
|
43
|
-
description="+label=Description +docs=Description of the artifact version",
|
|
43
|
+
description="+label=Description +usage=Description of the artifact or model version +docs=Description of the artifact or model version",
|
|
44
44
|
)
|
|
45
45
|
metadata: Dict[str, Any] = Field(
|
|
46
46
|
default=...,
|
|
47
|
-
description="+label=Metadata +docs=Metadata for the model version +usage=Metadata for the model version +uiType=JsonInput",
|
|
47
|
+
description="+label=Metadata +docs=Metadata for the artifact or model version +usage=Metadata for the artifact or model version +uiType=JsonInput",
|
|
48
48
|
)
|
|
49
49
|
type: Optional[StrictStr] = "model-version"
|
|
50
50
|
source: Source1 = Field(...)
|
|
@@ -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=Hidden",
|
|
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,8 +18,9 @@ import pprint
|
|
|
18
18
|
import re # noqa: F401
|
|
19
19
|
from typing import Optional
|
|
20
20
|
|
|
21
|
-
from truefoundry.ml.autogen.client.models.
|
|
22
|
-
|
|
21
|
+
from truefoundry.ml.autogen.client.models.sklearn_model_schema import SklearnModelSchema
|
|
22
|
+
from truefoundry.ml.autogen.client.models.sklearn_serialization_format import (
|
|
23
|
+
SklearnSerializationFormat,
|
|
23
24
|
)
|
|
24
25
|
from truefoundry.pydantic_v1 import BaseModel, Field, StrictStr, validator
|
|
25
26
|
|
|
@@ -33,11 +34,13 @@ class SklearnFramework(BaseModel):
|
|
|
33
34
|
default=...,
|
|
34
35
|
description="+label=Type +usage=Type of the framework +value=sklearn",
|
|
35
36
|
)
|
|
36
|
-
|
|
37
|
+
model_filepath: Optional[StrictStr] = Field(
|
|
37
38
|
default=None,
|
|
38
|
-
description="+label=
|
|
39
|
+
description="+label=Model file path +usage=Relative path to the model file",
|
|
39
40
|
)
|
|
40
|
-
|
|
41
|
+
serialization_format: Optional[SklearnSerializationFormat] = None
|
|
42
|
+
model_schema: Optional[SklearnModelSchema] = None
|
|
43
|
+
__properties = ["type", "model_filepath", "serialization_format", "model_schema"]
|
|
41
44
|
|
|
42
45
|
@validator("type")
|
|
43
46
|
def type_validate_enum(cls, value):
|
|
@@ -68,6 +71,9 @@ class SklearnFramework(BaseModel):
|
|
|
68
71
|
def to_dict(self):
|
|
69
72
|
"""Returns the dictionary representation of the model using alias"""
|
|
70
73
|
_dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
|
|
74
|
+
# override the default output from truefoundry.pydantic_v1 by calling `to_dict()` of model_schema
|
|
75
|
+
if self.model_schema:
|
|
76
|
+
_dict["model_schema"] = self.model_schema.to_dict()
|
|
71
77
|
return _dict
|
|
72
78
|
|
|
73
79
|
@classmethod
|
|
@@ -82,7 +88,11 @@ class SklearnFramework(BaseModel):
|
|
|
82
88
|
_obj = SklearnFramework.parse_obj(
|
|
83
89
|
{
|
|
84
90
|
"type": obj.get("type"),
|
|
91
|
+
"model_filepath": obj.get("model_filepath"),
|
|
85
92
|
"serialization_format": obj.get("serialization_format"),
|
|
93
|
+
"model_schema": SklearnModelSchema.from_dict(obj.get("model_schema"))
|
|
94
|
+
if obj.get("model_schema") is not None
|
|
95
|
+
else None,
|
|
86
96
|
}
|
|
87
97
|
)
|
|
88
98
|
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
|
+
+label=Sklearn Model Schema # noqa: E501
|
|
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
|
truefoundry/ml/autogen/client/models/{serialization_format.py → sklearn_serialization_format.py}
RENAMED
|
@@ -17,9 +17,9 @@ import re # noqa: F401
|
|
|
17
17
|
from aenum import Enum
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
class
|
|
20
|
+
class SklearnSerializationFormat(str, Enum):
|
|
21
21
|
"""
|
|
22
|
-
+label=Serialization format +usage=Serialization format used for
|
|
22
|
+
+label=Serialization format +usage=Serialization format used for sklearn models
|
|
23
23
|
"""
|
|
24
24
|
|
|
25
25
|
"""
|
|
@@ -30,6 +30,6 @@ class SerializationFormat(str, Enum):
|
|
|
30
30
|
PICKLE = "pickle"
|
|
31
31
|
|
|
32
32
|
@classmethod
|
|
33
|
-
def from_json(cls, json_str: str) ->
|
|
34
|
-
"""Create an instance of
|
|
35
|
-
return
|
|
33
|
+
def from_json(cls, json_str: str) -> SklearnSerializationFormat:
|
|
34
|
+
"""Create an instance of SklearnSerializationFormat from a JSON string"""
|
|
35
|
+
return SklearnSerializationFormat(json.loads(json_str))
|
|
@@ -37,11 +37,11 @@ class TransformersFramework(BaseModel):
|
|
|
37
37
|
)
|
|
38
38
|
pipeline_tag: Optional[StrictStr] = Field(
|
|
39
39
|
default=None,
|
|
40
|
-
description="+label=Pipeline Tag +usage=
|
|
40
|
+
description="+label=Pipeline Tag +usage=The `pipeline()` task this model can be used with e.g. `text-generation`. See [huggingface docs](https://huggingface.co/docs/transformers/main/en/main_classes/pipelines#transformers.pipeline.task) for all possible values +docs=Pipeline tag for the framework",
|
|
41
41
|
)
|
|
42
42
|
base_model: Optional[StrictStr] = Field(
|
|
43
43
|
default=None,
|
|
44
|
-
description="+label=Base Model +usage=Base model +docs=Base model Id. If this is a finetuned model, this points to the base model used for finetuning",
|
|
44
|
+
description="+label=Base Model +usage=Base model Id. If this is a finetuned model, this points to the base model used for finetuning +docs=Base model Id. If this is a finetuned model, this points to the base model used for finetuning",
|
|
45
45
|
)
|
|
46
46
|
__properties = ["type", "library_name", "pipeline_tag", "base_model"]
|
|
47
47
|
|
|
@@ -0,0 +1,71 @@
|
|
|
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
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class ValidateExternalStorageRootRequestDto(BaseModel):
|
|
24
|
+
"""
|
|
25
|
+
ValidateExternalStorageRootRequestDto
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
storage_root_uri: StrictStr = Field(...)
|
|
29
|
+
experiment_id: StrictStr = Field(...)
|
|
30
|
+
__properties = ["storage_root_uri", "experiment_id"]
|
|
31
|
+
|
|
32
|
+
class Config:
|
|
33
|
+
"""Pydantic configuration"""
|
|
34
|
+
|
|
35
|
+
allow_population_by_field_name = True
|
|
36
|
+
validate_assignment = True
|
|
37
|
+
|
|
38
|
+
def to_str(self) -> str:
|
|
39
|
+
"""Returns the string representation of the model using alias"""
|
|
40
|
+
return pprint.pformat(self.dict(by_alias=True))
|
|
41
|
+
|
|
42
|
+
def to_json(self) -> str:
|
|
43
|
+
"""Returns the JSON representation of the model using alias"""
|
|
44
|
+
return json.dumps(self.to_dict())
|
|
45
|
+
|
|
46
|
+
@classmethod
|
|
47
|
+
def from_json(cls, json_str: str) -> ValidateExternalStorageRootRequestDto:
|
|
48
|
+
"""Create an instance of ValidateExternalStorageRootRequestDto from a JSON string"""
|
|
49
|
+
return cls.from_dict(json.loads(json_str))
|
|
50
|
+
|
|
51
|
+
def to_dict(self):
|
|
52
|
+
"""Returns the dictionary representation of the model using alias"""
|
|
53
|
+
_dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
|
|
54
|
+
return _dict
|
|
55
|
+
|
|
56
|
+
@classmethod
|
|
57
|
+
def from_dict(cls, obj: dict) -> ValidateExternalStorageRootRequestDto:
|
|
58
|
+
"""Create an instance of ValidateExternalStorageRootRequestDto from a dict"""
|
|
59
|
+
if obj is None:
|
|
60
|
+
return None
|
|
61
|
+
|
|
62
|
+
if not isinstance(obj, dict):
|
|
63
|
+
return ValidateExternalStorageRootRequestDto.parse_obj(obj)
|
|
64
|
+
|
|
65
|
+
_obj = ValidateExternalStorageRootRequestDto.parse_obj(
|
|
66
|
+
{
|
|
67
|
+
"storage_root_uri": obj.get("storage_root_uri"),
|
|
68
|
+
"experiment_id": obj.get("experiment_id"),
|
|
69
|
+
}
|
|
70
|
+
)
|
|
71
|
+
return _obj
|
|
@@ -0,0 +1,69 @@
|
|
|
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.pydantic_v1 import BaseModel, Field, StrictBool, StrictStr
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class ValidateExternalStorageRootResponseDto(BaseModel):
|
|
25
|
+
"""
|
|
26
|
+
ValidateExternalStorageRootResponseDto
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
is_valid: StrictBool = Field(...)
|
|
30
|
+
message: Optional[StrictStr] = None
|
|
31
|
+
__properties = ["is_valid", "message"]
|
|
32
|
+
|
|
33
|
+
class Config:
|
|
34
|
+
"""Pydantic configuration"""
|
|
35
|
+
|
|
36
|
+
allow_population_by_field_name = True
|
|
37
|
+
validate_assignment = True
|
|
38
|
+
|
|
39
|
+
def to_str(self) -> str:
|
|
40
|
+
"""Returns the string representation of the model using alias"""
|
|
41
|
+
return pprint.pformat(self.dict(by_alias=True))
|
|
42
|
+
|
|
43
|
+
def to_json(self) -> str:
|
|
44
|
+
"""Returns the JSON representation of the model using alias"""
|
|
45
|
+
return json.dumps(self.to_dict())
|
|
46
|
+
|
|
47
|
+
@classmethod
|
|
48
|
+
def from_json(cls, json_str: str) -> ValidateExternalStorageRootResponseDto:
|
|
49
|
+
"""Create an instance of ValidateExternalStorageRootResponseDto from a JSON string"""
|
|
50
|
+
return cls.from_dict(json.loads(json_str))
|
|
51
|
+
|
|
52
|
+
def to_dict(self):
|
|
53
|
+
"""Returns the dictionary representation of the model using alias"""
|
|
54
|
+
_dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
|
|
55
|
+
return _dict
|
|
56
|
+
|
|
57
|
+
@classmethod
|
|
58
|
+
def from_dict(cls, obj: dict) -> ValidateExternalStorageRootResponseDto:
|
|
59
|
+
"""Create an instance of ValidateExternalStorageRootResponseDto from a dict"""
|
|
60
|
+
if obj is None:
|
|
61
|
+
return None
|
|
62
|
+
|
|
63
|
+
if not isinstance(obj, dict):
|
|
64
|
+
return ValidateExternalStorageRootResponseDto.parse_obj(obj)
|
|
65
|
+
|
|
66
|
+
_obj = ValidateExternalStorageRootResponseDto.parse_obj(
|
|
67
|
+
{"is_valid": obj.get("is_valid"), "message": obj.get("message")}
|
|
68
|
+
)
|
|
69
|
+
return _obj
|
|
@@ -18,8 +18,11 @@ import pprint
|
|
|
18
18
|
import re # noqa: F401
|
|
19
19
|
from typing import Optional
|
|
20
20
|
|
|
21
|
-
from truefoundry.ml.autogen.client.models.
|
|
22
|
-
|
|
21
|
+
from truefoundry.ml.autogen.client.models.xg_boost_model_schema import (
|
|
22
|
+
XGBoostModelSchema,
|
|
23
|
+
)
|
|
24
|
+
from truefoundry.ml.autogen.client.models.xg_boost_serialization_format import (
|
|
25
|
+
XGBoostSerializationFormat,
|
|
23
26
|
)
|
|
24
27
|
from truefoundry.pydantic_v1 import BaseModel, Field, StrictStr, validator
|
|
25
28
|
|
|
@@ -33,11 +36,13 @@ class XGBoostFramework(BaseModel):
|
|
|
33
36
|
default=...,
|
|
34
37
|
description="+label=Type +usage=Type of the framework +value=xgboost",
|
|
35
38
|
)
|
|
36
|
-
serialization_format: Optional[
|
|
39
|
+
serialization_format: Optional[XGBoostSerializationFormat] = None
|
|
40
|
+
model_filepath: Optional[StrictStr] = Field(
|
|
37
41
|
default=None,
|
|
38
|
-
description="+label=
|
|
42
|
+
description="+label=Model file path +usage=Relative path to the model file",
|
|
39
43
|
)
|
|
40
|
-
|
|
44
|
+
model_schema: Optional[XGBoostModelSchema] = None
|
|
45
|
+
__properties = ["type", "serialization_format", "model_filepath", "model_schema"]
|
|
41
46
|
|
|
42
47
|
@validator("type")
|
|
43
48
|
def type_validate_enum(cls, value):
|
|
@@ -68,6 +73,9 @@ class XGBoostFramework(BaseModel):
|
|
|
68
73
|
def to_dict(self):
|
|
69
74
|
"""Returns the dictionary representation of the model using alias"""
|
|
70
75
|
_dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
|
|
76
|
+
# override the default output from truefoundry.pydantic_v1 by calling `to_dict()` of model_schema
|
|
77
|
+
if self.model_schema:
|
|
78
|
+
_dict["model_schema"] = self.model_schema.to_dict()
|
|
71
79
|
return _dict
|
|
72
80
|
|
|
73
81
|
@classmethod
|
|
@@ -83,6 +91,10 @@ class XGBoostFramework(BaseModel):
|
|
|
83
91
|
{
|
|
84
92
|
"type": obj.get("type"),
|
|
85
93
|
"serialization_format": obj.get("serialization_format"),
|
|
94
|
+
"model_filepath": obj.get("model_filepath"),
|
|
95
|
+
"model_schema": XGBoostModelSchema.from_dict(obj.get("model_schema"))
|
|
96
|
+
if obj.get("model_schema") is not None
|
|
97
|
+
else None,
|
|
86
98
|
}
|
|
87
99
|
)
|
|
88
100
|
return _obj
|
|
@@ -0,0 +1,88 @@
|
|
|
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.pydantic_v1 import BaseModel, Field, StrictStr, conlist, validator
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class XGBoostModelSchema(BaseModel):
|
|
25
|
+
"""
|
|
26
|
+
+label=XGBoost Model Schema # noqa: E501
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
infer_method_name: StrictStr = Field(
|
|
30
|
+
default=...,
|
|
31
|
+
description="+label=Inference Method Name +usage=Name of the method used for inference",
|
|
32
|
+
)
|
|
33
|
+
inputs: conlist(Dict[str, Any]) = Field(
|
|
34
|
+
default=..., description="+label= Input Schema +usage=Schema of the input"
|
|
35
|
+
)
|
|
36
|
+
outputs: conlist(Dict[str, Any]) = Field(
|
|
37
|
+
default=..., description="+label= Output Schema +usage=Schema of the output"
|
|
38
|
+
)
|
|
39
|
+
__properties = ["infer_method_name", "inputs", "outputs"]
|
|
40
|
+
|
|
41
|
+
@validator("infer_method_name")
|
|
42
|
+
def infer_method_name_validate_enum(cls, value):
|
|
43
|
+
"""Validates the enum"""
|
|
44
|
+
if value not in ("predict",):
|
|
45
|
+
raise ValueError("must be one of enum values ('predict')")
|
|
46
|
+
return value
|
|
47
|
+
|
|
48
|
+
class Config:
|
|
49
|
+
"""Pydantic configuration"""
|
|
50
|
+
|
|
51
|
+
allow_population_by_field_name = True
|
|
52
|
+
validate_assignment = True
|
|
53
|
+
|
|
54
|
+
def to_str(self) -> str:
|
|
55
|
+
"""Returns the string representation of the model using alias"""
|
|
56
|
+
return pprint.pformat(self.dict(by_alias=True))
|
|
57
|
+
|
|
58
|
+
def to_json(self) -> str:
|
|
59
|
+
"""Returns the JSON representation of the model using alias"""
|
|
60
|
+
return json.dumps(self.to_dict())
|
|
61
|
+
|
|
62
|
+
@classmethod
|
|
63
|
+
def from_json(cls, json_str: str) -> XGBoostModelSchema:
|
|
64
|
+
"""Create an instance of XGBoostModelSchema from a JSON string"""
|
|
65
|
+
return cls.from_dict(json.loads(json_str))
|
|
66
|
+
|
|
67
|
+
def to_dict(self):
|
|
68
|
+
"""Returns the dictionary representation of the model using alias"""
|
|
69
|
+
_dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
|
|
70
|
+
return _dict
|
|
71
|
+
|
|
72
|
+
@classmethod
|
|
73
|
+
def from_dict(cls, obj: dict) -> XGBoostModelSchema:
|
|
74
|
+
"""Create an instance of XGBoostModelSchema from a dict"""
|
|
75
|
+
if obj is None:
|
|
76
|
+
return None
|
|
77
|
+
|
|
78
|
+
if not isinstance(obj, dict):
|
|
79
|
+
return XGBoostModelSchema.parse_obj(obj)
|
|
80
|
+
|
|
81
|
+
_obj = XGBoostModelSchema.parse_obj(
|
|
82
|
+
{
|
|
83
|
+
"infer_method_name": obj.get("infer_method_name"),
|
|
84
|
+
"inputs": obj.get("inputs"),
|
|
85
|
+
"outputs": obj.get("outputs"),
|
|
86
|
+
}
|
|
87
|
+
)
|
|
88
|
+
return _obj
|
|
@@ -0,0 +1,36 @@
|
|
|
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 XGBoostSerializationFormat(str, Enum):
|
|
21
|
+
"""
|
|
22
|
+
+label=Serialization format +usage=Serialization format used for XGBoost models
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
"""
|
|
26
|
+
allowed enum values
|
|
27
|
+
"""
|
|
28
|
+
CLOUDPICKLE = "cloudpickle"
|
|
29
|
+
JOBLIB = "joblib"
|
|
30
|
+
PICKLE = "pickle"
|
|
31
|
+
JSON = "json"
|
|
32
|
+
|
|
33
|
+
@classmethod
|
|
34
|
+
def from_json(cls, json_str: str) -> XGBoostSerializationFormat:
|
|
35
|
+
"""Create an instance of XGBoostSerializationFormat from a JSON string"""
|
|
36
|
+
return XGBoostSerializationFormat(json.loads(json_str))
|
|
@@ -102,6 +102,7 @@ Class | Method | HTTP request | Description
|
|
|
102
102
|
*MlfoundryArtifactsApi* | [**delete_dataset_post**](truefoundry/ml/autogen/client/docs/MlfoundryArtifactsApi.md#delete_dataset_post) | **POST** /api/2.0/mlflow/mlfoundry-artifacts/datasets/delete | Delete Dataset
|
|
103
103
|
*MlfoundryArtifactsApi* | [**delete_files_for_dataset_delete**](truefoundry/ml/autogen/client/docs/MlfoundryArtifactsApi.md#delete_files_for_dataset_delete) | **DELETE** /api/2.0/mlflow/mlfoundry-artifacts/datasets/files/ | Delete Files For Dataset
|
|
104
104
|
*MlfoundryArtifactsApi* | [**delete_model_version_post**](truefoundry/ml/autogen/client/docs/MlfoundryArtifactsApi.md#delete_model_version_post) | **POST** /api/2.0/mlflow/mlfoundry-artifacts/model-versions/delete | Delete Model Version
|
|
105
|
+
*MlfoundryArtifactsApi* | [**export_deployment_files_by_fqn_post**](truefoundry/ml/autogen/client/docs/MlfoundryArtifactsApi.md#export_deployment_files_by_fqn_post) | **POST** /api/2.0/mlflow/mlfoundry-artifacts/model-versions/export-deployment-files-by-fqn | Export Deployment Files By Fqn
|
|
105
106
|
*MlfoundryArtifactsApi* | [**finalize_artifact_version_post**](truefoundry/ml/autogen/client/docs/MlfoundryArtifactsApi.md#finalize_artifact_version_post) | **POST** /api/2.0/mlflow/mlfoundry-artifacts/artifact-versions/finalize | Finalize Artifact Version
|
|
106
107
|
*MlfoundryArtifactsApi* | [**get_artifact_by_fqn_get**](truefoundry/ml/autogen/client/docs/MlfoundryArtifactsApi.md#get_artifact_by_fqn_get) | **GET** /api/2.0/mlflow/mlfoundry-artifacts/artifacts/get-by-fqn | Get Artifact By Fqn
|
|
107
108
|
*MlfoundryArtifactsApi* | [**get_artifact_by_id_get**](truefoundry/ml/autogen/client/docs/MlfoundryArtifactsApi.md#get_artifact_by_id_get) | **GET** /api/2.0/mlflow/mlfoundry-artifacts/artifacts/get | Get Artifact By Id
|
|
@@ -132,6 +133,7 @@ Class | Method | HTTP request | Description
|
|
|
132
133
|
*MlfoundryArtifactsApi* | [**update_artifact_version_post**](truefoundry/ml/autogen/client/docs/MlfoundryArtifactsApi.md#update_artifact_version_post) | **POST** /api/2.0/mlflow/mlfoundry-artifacts/artifact-versions/update | Update Artifact Version
|
|
133
134
|
*MlfoundryArtifactsApi* | [**update_dataset_post**](truefoundry/ml/autogen/client/docs/MlfoundryArtifactsApi.md#update_dataset_post) | **POST** /api/2.0/mlflow/mlfoundry-artifacts/datasets/update | Update Dataset
|
|
134
135
|
*MlfoundryArtifactsApi* | [**update_model_version_post**](truefoundry/ml/autogen/client/docs/MlfoundryArtifactsApi.md#update_model_version_post) | **POST** /api/2.0/mlflow/mlfoundry-artifacts/model-versions/update | Update Model Version
|
|
136
|
+
*MlfoundryArtifactsApi* | [**validate_external_storage_root_path_post**](truefoundry/ml/autogen/client/docs/MlfoundryArtifactsApi.md#validate_external_storage_root_path_post) | **POST** /api/2.0/mlflow/mlfoundry-artifacts/artifact-versions/validate-storage-root | Validate External Storage Root Path
|
|
135
137
|
*RunArtifactsApi* | [**list_run_artifacts_get**](truefoundry/ml/autogen/client/docs/RunArtifactsApi.md#list_run_artifacts_get) | **GET** /api/2.0/mlflow/artifacts/list | List Run Artifacts
|
|
136
138
|
*RunsApi* | [**create_run_post**](truefoundry/ml/autogen/client/docs/RunsApi.md#create_run_post) | **POST** /api/2.0/mlflow/runs/create | Create Run
|
|
137
139
|
*RunsApi* | [**delete_run_post**](truefoundry/ml/autogen/client/docs/RunsApi.md#delete_run_post) | **POST** /api/2.0/mlflow/runs/delete | Delete Run
|
|
@@ -211,6 +213,7 @@ Class | Method | HTTP request | Description
|
|
|
211
213
|
- [ExperimentIdRequestDto](truefoundry/ml/autogen/client/docs/ExperimentIdRequestDto.md)
|
|
212
214
|
- [ExperimentResponseDto](truefoundry/ml/autogen/client/docs/ExperimentResponseDto.md)
|
|
213
215
|
- [ExperimentTagDto](truefoundry/ml/autogen/client/docs/ExperimentTagDto.md)
|
|
216
|
+
- [ExportDeploymentFilesRequestDto](truefoundry/ml/autogen/client/docs/ExportDeploymentFilesRequestDto.md)
|
|
214
217
|
- [ExternalArtifactSource](truefoundry/ml/autogen/client/docs/ExternalArtifactSource.md)
|
|
215
218
|
- [FastAIFramework](truefoundry/ml/autogen/client/docs/FastAIFramework.md)
|
|
216
219
|
- [FileInfoDto](truefoundry/ml/autogen/client/docs/FileInfoDto.md)
|
|
@@ -233,6 +236,7 @@ Class | Method | HTTP request | Description
|
|
|
233
236
|
- [HTTPValidationError](truefoundry/ml/autogen/client/docs/HTTPValidationError.md)
|
|
234
237
|
- [ImageContentPart](truefoundry/ml/autogen/client/docs/ImageContentPart.md)
|
|
235
238
|
- [ImageUrl](truefoundry/ml/autogen/client/docs/ImageUrl.md)
|
|
239
|
+
- [InferMethodName](truefoundry/ml/autogen/client/docs/InferMethodName.md)
|
|
236
240
|
- [InternalMetadata](truefoundry/ml/autogen/client/docs/InternalMetadata.md)
|
|
237
241
|
- [KerasFramework](truefoundry/ml/autogen/client/docs/KerasFramework.md)
|
|
238
242
|
- [LatestRunLogDto](truefoundry/ml/autogen/client/docs/LatestRunLogDto.md)
|
|
@@ -270,6 +274,7 @@ Class | Method | HTTP request | Description
|
|
|
270
274
|
- [ModelConfiguration](truefoundry/ml/autogen/client/docs/ModelConfiguration.md)
|
|
271
275
|
- [ModelDto](truefoundry/ml/autogen/client/docs/ModelDto.md)
|
|
272
276
|
- [ModelResponseDto](truefoundry/ml/autogen/client/docs/ModelResponseDto.md)
|
|
277
|
+
- [ModelServer](truefoundry/ml/autogen/client/docs/ModelServer.md)
|
|
273
278
|
- [ModelVersionDto](truefoundry/ml/autogen/client/docs/ModelVersionDto.md)
|
|
274
279
|
- [ModelVersionEnvironment](truefoundry/ml/autogen/client/docs/ModelVersionEnvironment.md)
|
|
275
280
|
- [ModelVersionManifest](truefoundry/ml/autogen/client/docs/ModelVersionManifest.md)
|
|
@@ -295,11 +300,12 @@ Class | Method | HTTP request | Description
|
|
|
295
300
|
- [RunTagDto](truefoundry/ml/autogen/client/docs/RunTagDto.md)
|
|
296
301
|
- [SearchRunsRequestDto](truefoundry/ml/autogen/client/docs/SearchRunsRequestDto.md)
|
|
297
302
|
- [SearchRunsResponseDto](truefoundry/ml/autogen/client/docs/SearchRunsResponseDto.md)
|
|
298
|
-
- [SerializationFormat](truefoundry/ml/autogen/client/docs/SerializationFormat.md)
|
|
299
303
|
- [SetExperimentTagRequestDto](truefoundry/ml/autogen/client/docs/SetExperimentTagRequestDto.md)
|
|
300
304
|
- [SetTagRequestDto](truefoundry/ml/autogen/client/docs/SetTagRequestDto.md)
|
|
301
305
|
- [SignedURLDto](truefoundry/ml/autogen/client/docs/SignedURLDto.md)
|
|
302
306
|
- [SklearnFramework](truefoundry/ml/autogen/client/docs/SklearnFramework.md)
|
|
307
|
+
- [SklearnModelSchema](truefoundry/ml/autogen/client/docs/SklearnModelSchema.md)
|
|
308
|
+
- [SklearnSerializationFormat](truefoundry/ml/autogen/client/docs/SklearnSerializationFormat.md)
|
|
303
309
|
- [Source](truefoundry/ml/autogen/client/docs/Source.md)
|
|
304
310
|
- [Source1](truefoundry/ml/autogen/client/docs/Source1.md)
|
|
305
311
|
- [SpaCyFramework](truefoundry/ml/autogen/client/docs/SpaCyFramework.md)
|
|
@@ -324,9 +330,13 @@ Class | Method | HTTP request | Description
|
|
|
324
330
|
- [UpdateRunResponseDto](truefoundry/ml/autogen/client/docs/UpdateRunResponseDto.md)
|
|
325
331
|
- [Url](truefoundry/ml/autogen/client/docs/Url.md)
|
|
326
332
|
- [UserMessage](truefoundry/ml/autogen/client/docs/UserMessage.md)
|
|
333
|
+
- [ValidateExternalStorageRootRequestDto](truefoundry/ml/autogen/client/docs/ValidateExternalStorageRootRequestDto.md)
|
|
334
|
+
- [ValidateExternalStorageRootResponseDto](truefoundry/ml/autogen/client/docs/ValidateExternalStorageRootResponseDto.md)
|
|
327
335
|
- [ValidationError](truefoundry/ml/autogen/client/docs/ValidationError.md)
|
|
328
336
|
- [ValidationErrorLocInner](truefoundry/ml/autogen/client/docs/ValidationErrorLocInner.md)
|
|
329
337
|
- [XGBoostFramework](truefoundry/ml/autogen/client/docs/XGBoostFramework.md)
|
|
338
|
+
- [XGBoostModelSchema](truefoundry/ml/autogen/client/docs/XGBoostModelSchema.md)
|
|
339
|
+
- [XGBoostSerializationFormat](truefoundry/ml/autogen/client/docs/XGBoostSerializationFormat.md)
|
|
330
340
|
|
|
331
341
|
|
|
332
342
|
<a id="documentation-for-authorization"></a>
|