ModelVersion
- Implements: IModelVersion
This class encapsulates and extends the ROS resource type ALIYUN::PAI::ModelVersion.
Initializers
import ros_cdk_pai
ros_cdk_pai.ModelVersion(
scope: Construct,
id: str,
model_id: typing.Union[str, IResolvable],
uri: typing.Union[str, IResolvable],
approval_status: typing.Union[str, IResolvable] = None,
extra_info: typing.Union[IResolvable, typing.Mapping[typing.Any]] = None,
format_type: typing.Union[str, IResolvable] = None,
framework_type: typing.Union[str, IResolvable] = None,
inference_spec: typing.Union[IResolvable, typing.Mapping[typing.Any]] = None,
labels: typing.Union[IResolvable, typing.List[typing.Union[IResolvable, LabelsProperty]]] = None,
metrics: typing.Union[IResolvable, typing.Mapping[typing.Any]] = None,
options: typing.Union[str, IResolvable] = None,
source_id: typing.Union[str, IResolvable] = None,
source_type: typing.Union[str, IResolvable] = None,
training_spec: typing.Union[IResolvable, typing.Mapping[typing.Any]] = None,
version_description: typing.Union[str, IResolvable] = None,
version_name: typing.Union[str, IResolvable] = None,
enable_resource_property_constraint: bool = None
)
| Name | Type | Description |
|---|---|---|
scope | ros_cdk_core.Construct | No description. |
id | str | No description. |
model_id | typing.Union[str, ros_cdk_core.IResolvable] | Property modelId: Model ID. |
uri | typing.Union[str, ros_cdk_core.IResolvable] | Property uri: Model version URI, that is, the location where the model is stored. |
approval_status | typing.Union[str, ros_cdk_core.IResolvable] | Property approvalStatus: Admission status, with values as follows: - Pending: to be determined. |
extra_info | typing.Union[ros_cdk_core.IResolvable, typing.Mapping[typing.Any]] | Property extraInfo: The additional information. |
format_type | typing.Union[str, ros_cdk_core.IResolvable] | Property formatType: Model format, possible values: - OfflineModel - SavedModel - Keras H5 - Frozen Pb - Caffe Prototxt - TorchScript - XGBoost - PMML - AlinkModel - ONNX. |
framework_type | typing.Union[str, ros_cdk_core.IResolvable] | Property frameworkType: Model framework, possible values: - Pytorch - XGBoost - Keras - Caffe - Alink - Xflow - TensorFlow. |
inference_spec | typing.Union[ros_cdk_core.IResolvable, typing.Mapping[typing.Any]] | Property inferenceSpec: Describes how to apply to downstream inference services. |
labels | typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[ros_cdk_core.IResolvable, LabelsProperty]]] | Property labels: List of model version labels. |
metrics | typing.Union[ros_cdk_core.IResolvable, typing.Mapping[typing.Any]] | Property metrics: The metrics for the model. |
options | typing.Union[str, ros_cdk_core.IResolvable] | Property options: The extended field. |
source_id | typing.Union[str, ros_cdk_core.IResolvable] | Property sourceId: Source ID. |
source_type | typing.Union[str, ros_cdk_core.IResolvable] | Property sourceType: Model source type, possible values: - Custom: Custom. |
training_spec | typing.Union[ros_cdk_core.IResolvable, typing.Mapping[typing.Any]] | Property trainingSpec: Training configuration. |
version_description | typing.Union[str, ros_cdk_core.IResolvable] | Property versionDescription: Model version description. |
version_name | typing.Union[str, ros_cdk_core.IResolvable] | Property versionName: The model version, which is unique for each model. |
enable_resource_property_constraint | bool | No description. |
scopeRequired
- Type: ros_cdk_core.Construct
idRequired
- Type: str
model_idRequired
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property modelId: Model ID.
For details about how to obtain the model ID.
uriRequired
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property uri: Model version URI, that is, the location where the model is stored.
Possible values are:
- The HTTP(S) address of the model, for example: 'https://myweb.com/mymodel.tar.gz '.
- If the model is stored in OSS, the format is 'oss://
. /object '. For the endpoint configuration, see Access domain name and data center. For example, see OSS:// mybucket/'.
approval_statusOptional
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property approvalStatus: Admission status, with values as follows: - Pending: to be determined.
- Approved: Allow to go online.
- Rejected: Online is not allowed.
extra_infoOptional
- Type: typing.Union[ros_cdk_core.IResolvable, typing.Mapping[typing.Any]]
Property extraInfo: The additional information.
format_typeOptional
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property formatType: Model format, possible values: - OfflineModel - SavedModel - Keras H5 - Frozen Pb - Caffe Prototxt - TorchScript - XGBoost - PMML - AlinkModel - ONNX.
framework_typeOptional
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property frameworkType: Model framework, possible values: - Pytorch - XGBoost - Keras - Caffe - Alink - Xflow - TensorFlow.
inference_specOptional
- Type: typing.Union[ros_cdk_core.IResolvable, typing.Mapping[typing.Any]]
Property inferenceSpec: Describes how to apply to downstream inference services.
For example, describe the processor and container of EAS. Example: { "processor": "tensorflow_gpu_1.12" }
labelsOptional
- Type: typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[ros_cdk_core.IResolvable, LabelsProperty]]]
Property labels: List of model version labels.
metricsOptional
- Type: typing.Union[ros_cdk_core.IResolvable, typing.Mapping[typing.Any]]
Property metrics: The metrics for the model.
The length after serialization is limited to 8,192. Example: { "Results": [{ "Dataset": { "DatasetId": "d-sdkjanksaklerhfd" }, "Metrics": { "cer": 0.175 } }, { "Dataset": { "Uri": "oss://xxxx/" }, "Metrics": { "cer": 0.172 } }] }
optionsOptional
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property options: The extended field.
This is a JSON string.
source_idOptional
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property sourceId: Source ID.
- When the source type is Custom, this field is not restricted.
-
When the source is PAIFlow or TrainingService, the format is: region=
,workspaceId= ,kind= ,id= Among them: -
region is the Alibaba Cloud region ID.
- workspaceId indicates the workspace ID.
- kind: is a type. Value: PipelineRun(PAIFlow workflow);ServiceJob (training service).
- id: is a unique identifier.
source_typeOptional
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property sourceType: Model source type, possible values: - Custom: Custom.
- PAIFlow:PAI workflow.
- TrainingService:PAI training service.
training_specOptional
- Type: typing.Union[ros_cdk_core.IResolvable, typing.Mapping[typing.Any]]
Property trainingSpec: Training configuration.
Configuration for fine-tuning, incremental training.
version_descriptionOptional
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property versionDescription: Model version description.
version_nameOptional
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property versionName: The model version, which is unique for each model.
If you leave this parameter empty, the first version is 0.1.0 by default. After that, the minor version number is increased by 1 in sequence. For example, the second version number is 0.2.0. A version number consists of a major version number, a minor version number, and a stage version number, separated by periods (.). The major version number and minor version number are numeric. The stage version number begins with a digit and can include numbers, underscores, and letters. For example, the version number is 1.1.0 or 2.3.4_beta.
enable_resource_property_constraintOptional
- Type: bool
Methods
| Name | Description |
|---|---|
to_string | Returns a string representation of this construct. |
synthesize | Allows this construct to emit artifacts into the cloud assembly during synthesis. |
add_condition | No description. |
add_count | No description. |
add_dependency | No description. |
add_resource_desc | No description. |
apply_removal_policy | No description. |
fetch_condition | No description. |
fetch_dependency | No description. |
fetch_resource_desc | No description. |
get_att | No description. |
set_metadata | No description. |
to_string
def to_string() -> str
Returns a string representation of this construct.
synthesize
def synthesize(
session: ISynthesisSession
) -> None
Allows this construct to emit artifacts into the cloud assembly during synthesis.
This method is usually implemented by framework-level constructs such as Stack and Asset as they participate in synthesizing the cloud assembly.
- Type: ros_cdk_core.ISynthesisSession
The synthesis session.
add_condition
def add_condition(
condition: RosCondition
) -> None
- Type: ros_cdk_core.RosCondition
add_count
def add_count(
count: typing.Union[typing.Union[int, float], IResolvable]
) -> None
- Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]
add_dependency
def add_dependency(
resource: Resource
) -> None
- Type: ros_cdk_core.Resource
add_resource_desc
def add_resource_desc(
desc: str
) -> None
- Type: str
apply_removal_policy
def apply_removal_policy(
policy: RemovalPolicy
) -> None
- Type: ros_cdk_core.RemovalPolicy
fetch_condition
def fetch_condition() -> RosCondition
fetch_dependency
def fetch_dependency() -> typing.List[str]
fetch_resource_desc
def fetch_resource_desc() -> str
get_att
def get_att(
name: str
) -> IResolvable
- Type: str
set_metadata
def set_metadata(
key: str,
value: typing.Any
) -> None
- Type: str
- Type: typing.Any
Static Functions
| Name | Description |
|---|---|
is_construct | Return whether the given object is a Construct. |
is_construct
import ros_cdk_pai
ros_cdk_pai.ModelVersion.is_construct(
x: typing.Any
)
Return whether the given object is a Construct.
- Type: typing.Any
Properties
| Name | Type | Description |
|---|---|---|
node | ros_cdk_core.ConstructNode | The construct tree node associated with this construct. |
env | ros_cdk_core.IResourceEnvironment | The environment this resource belongs to. |
ref | str | No description. |
stack | ros_cdk_core.Stack | The stack in which this resource is defined. |
resource | ros_cdk_core.RosResource | No description. |
attr_approval_status | typing.Union[str, ros_cdk_core.IResolvable] | Attribute ApprovalStatus: Admission status, with values as follows:. |
attr_extra_info | typing.Union[str, ros_cdk_core.IResolvable] | Attribute ExtraInfo: Other information. |
attr_format_type | typing.Union[str, ros_cdk_core.IResolvable] | Attribute FormatType: Model format, possible values:. |
attr_framework_type | typing.Union[str, ros_cdk_core.IResolvable] | Attribute FrameworkType: Model framework, possible values:. |
attr_gmt_create_time | typing.Union[str, ros_cdk_core.IResolvable] | Attribute GmtCreateTime: Create a model UTC time in the format ISO8601. |
attr_gmt_modified_time | typing.Union[str, ros_cdk_core.IResolvable] | Attribute GmtModifiedTime: Finally, update the model UTC time in the format iso8601. |
attr_inference_spec | typing.Union[str, ros_cdk_core.IResolvable] | Attribute InferenceSpec: Describes how to apply to downstream inference services, such as processors and containers of EAS. |
attr_labels | typing.Union[str, ros_cdk_core.IResolvable] | Attribute Labels: List of model version labels. |
attr_metrics | typing.Union[str, ros_cdk_core.IResolvable] | Attribute Metrics: Model indicators. |
attr_options | typing.Union[str, ros_cdk_core.IResolvable] | Attribute Options: Extension field. |
attr_owner_id | typing.Union[str, ros_cdk_core.IResolvable] | Attribute OwnerId: The Alibaba Cloud account ID. |
attr_source_id | typing.Union[str, ros_cdk_core.IResolvable] | Attribute SourceId: Source ID. |
attr_source_type | typing.Union[str, ros_cdk_core.IResolvable] | Attribute SourceType: Model source type, possible values:. |
attr_training_spec | typing.Union[str, ros_cdk_core.IResolvable] | Attribute TrainingSpec: Training configuration. |
attr_uri | typing.Union[str, ros_cdk_core.IResolvable] | Attribute Uri: Model version URI, that is, the location where the model is stored. |
attr_user_id | typing.Union[str, ros_cdk_core.IResolvable] | Attribute UserId: The user ID. |
attr_version_description | typing.Union[str, ros_cdk_core.IResolvable] | Attribute VersionDescription: Model version description. |
attr_version_name | typing.Union[str, ros_cdk_core.IResolvable] | Attribute VersionName: Model version. |
props | ModelVersionProps | No description. |
nodeRequired
node: ConstructNode
- Type: ros_cdk_core.ConstructNode
The construct tree node associated with this construct.
envRequired
env: IResourceEnvironment
- Type: ros_cdk_core.IResourceEnvironment
The environment this resource belongs to.
For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.
refRequired
ref: str
- Type: str
stackRequired
stack: Stack
- Type: ros_cdk_core.Stack
The stack in which this resource is defined.
resourceOptional
resource: RosResource
- Type: ros_cdk_core.RosResource
attr_approval_statusRequired
attr_approval_status: typing.Union[str, IResolvable]
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Attribute ApprovalStatus: Admission status, with values as follows:.
attr_extra_infoRequired
attr_extra_info: typing.Union[str, IResolvable]
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Attribute ExtraInfo: Other information.
attr_format_typeRequired
attr_format_type: typing.Union[str, IResolvable]
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Attribute FormatType: Model format, possible values:.
attr_framework_typeRequired
attr_framework_type: typing.Union[str, IResolvable]
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Attribute FrameworkType: Model framework, possible values:.
attr_gmt_create_timeRequired
attr_gmt_create_time: typing.Union[str, IResolvable]
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Attribute GmtCreateTime: Create a model UTC time in the format ISO8601.
attr_gmt_modified_timeRequired
attr_gmt_modified_time: typing.Union[str, IResolvable]
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Attribute GmtModifiedTime: Finally, update the model UTC time in the format iso8601.
attr_inference_specRequired
attr_inference_spec: typing.Union[str, IResolvable]
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Attribute InferenceSpec: Describes how to apply to downstream inference services, such as processors and containers of EAS.
attr_labelsRequired
attr_labels: typing.Union[str, IResolvable]
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Attribute Labels: List of model version labels.
attr_metricsRequired
attr_metrics: typing.Union[str, IResolvable]
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Attribute Metrics: Model indicators.
attr_optionsRequired
attr_options: typing.Union[str, IResolvable]
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Attribute Options: Extension field.
The JsonString type.
attr_owner_idRequired
attr_owner_id: typing.Union[str, IResolvable]
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Attribute OwnerId: The Alibaba Cloud account ID.
attr_source_idRequired
attr_source_id: typing.Union[str, IResolvable]
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Attribute SourceId: Source ID.
attr_source_typeRequired
attr_source_type: typing.Union[str, IResolvable]
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Attribute SourceType: Model source type, possible values:.
attr_training_specRequired
attr_training_spec: typing.Union[str, IResolvable]
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Attribute TrainingSpec: Training configuration.
Configuration for fine-tuning, incremental training.
attr_uriRequired
attr_uri: typing.Union[str, IResolvable]
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Attribute Uri: Model version URI, that is, the location where the model is stored.
attr_user_idRequired
attr_user_id: typing.Union[str, IResolvable]
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Attribute UserId: The user ID.
attr_version_descriptionRequired
attr_version_description: typing.Union[str, IResolvable]
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Attribute VersionDescription: Model version description.
attr_version_nameRequired
attr_version_name: typing.Union[str, IResolvable]
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Attribute VersionName: Model version.
propsRequired
props: ModelVersionProps
- Type: ModelVersionProps