Skip to content
v2.274.0

Experimental

@aws-cdk/aws-sagemaker-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.

ModelData Class ​

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

Example ​

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

declare const image: sagemaker.ContainerImage;
declare const modelData: sagemaker.ModelData;

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

Initializer ​

ts
new ModelData()
python
ModelData()
java
new ModelData()
csharp
new ModelData()
go
NewModelData()

Methods ​

bind(scope: Construct, model: IModel): ModelDataConfigdef bind(self, scope: Construct, model: IModel) -> ModelDataConfigpublic ModelDataConfig bind(Construct scope, IModel model)public ModelDataConfig Bind(Construct scope, IModel model)func Bind(Scope Construct, Model IModel) ModelDataConfig#
This method is invoked by the SageMaker Model construct when it needs to resolve the model data to a URI.
2 parameters

Parameters

  • scopescopescopescopeScope — The scope within which the model data is resolved.
  • modelmodelmodelmodelModel — The Model construct performing the URI resolution.
fromAsset(path: string, options?: AssetOptions): ModelData // chainable@staticmethod def from_asset(path: str, options: typing.Optional[AssetOptions] = None) -> ModelDatapublic static ModelData fromAsset(String path, AssetOptions options)public static ModelData FromAsset(string path, AssetOptions? options = null)func FromAsset(Path *string, Options AssetOptions) ModelDatastatic#
Constructs model data that will be uploaded to S3 as part of the CDK app deployment.
2 parameters

Parameters

  • pathpathpathpathPath — The local path to a model artifact file as a gzipped tar file.
  • optionsoptionsoptionsoptionsOptions — The options to further configure the selected asset.
fromBucket(bucket: IBucket, objectKey: string): ModelData // chainable@staticmethod def from_bucket(bucket: IBucket, object_key: str) -> ModelDatapublic static ModelData fromBucket(IBucket bucket, String objectKey)public static ModelData FromBucket(IBucket bucket, string objectKey)func FromBucket(Bucket IBucket, ObjectKey *string) ModelDatastatic#
Constructs model data which is already available within S3.
2 parameters

Parameters

  • bucketbucketbucketbucketBucket — The S3 bucket within which the model artifacts are stored.
  • objectKeyobject_keyobjectKeyobjectKeyObjectKey — The S3 object key at which the model artifacts are stored.