@aws-cdk_aws-sagemaker-alpha.ModelData

class ModelData ๐Ÿ”น

LanguageType name
.NETAmazon.CDK.AWS.Sagemaker.Alpha.ModelData
Gogithub.com/aws/aws-cdk-go/awscdksagemakeralpha/v2#ModelData
Javasoftware.amazon.awscdk.services.sagemaker.alpha.ModelData
Pythonaws_cdk.aws_sagemaker_alpha.ModelData
TypeScript (source)@aws-cdk/aws-sagemaker-alpha ยป ModelData

Model data represents the source of model artifacts, which will ultimately be loaded from an S3 location.

Example

import * as sagemaker from '@aws-cdk/aws-sagemaker-alpha';
import * as path from 'path';

const image = sagemaker.ContainerImage.fromAsset(path.join('path', 'to', 'Dockerfile', 'directory'));
const modelData = sagemaker.ModelData.fromAsset(path.join('path', 'to', 'artifact', 'file.tar.gz'));

const model = new sagemaker.Model(this, 'PrimaryContainerModel', {
  containers: [
    {
      image: image,
      modelData: modelData,
    }
  ]
});

Initializer

new ModelData()

Methods

NameDescription
bind(scope, model)๐Ÿ”นThis method is invoked by the SageMaker Model construct when it needs to resolve the model data to a URI.
static fromAsset(path, options?)๐Ÿ”นConstructs model data that will be uploaded to S3 as part of the CDK app deployment.
static fromBucket(bucket, objectKey)๐Ÿ”นConstructs model data which is already available within S3.

bind(scope, model)๐Ÿ”น

public bind(scope: Construct, model: IModel): ModelDataConfig

Parameters

  • scope Construct โ€” The scope within which the model data is resolved.
  • model IModel โ€” The Model construct performing the URI resolution.

Returns

  • ModelDataConfig

This method is invoked by the SageMaker Model construct when it needs to resolve the model data to a URI.


static fromAsset(path, options?)๐Ÿ”น

public static fromAsset(path: string, options?: AssetOptions): ModelData

Parameters

  • path string โ€” The local path to a model artifact file as a gzipped tar file.
  • options AssetOptions โ€” The options to further configure the selected asset.

Returns

  • ModelData

Constructs model data that will be uploaded to S3 as part of the CDK app deployment.


static fromBucket(bucket, objectKey)๐Ÿ”น

public static fromBucket(bucket: IBucket, objectKey: string): ModelData

Parameters

  • bucket IBucket โ€” The S3 bucket within which the model artifacts are stored.
  • objectKey string โ€” The S3 object key at which the model artifacts are stored.

Returns

  • ModelData

Constructs model data which is already available within S3.