Struct aws_sdk_sagemaker::types::builders::S3ModelDataSourceBuilder
source · #[non_exhaustive]pub struct S3ModelDataSourceBuilder { /* private fields */ }
Expand description
A builder for S3ModelDataSource
.
Implementations§
source§impl S3ModelDataSourceBuilder
impl S3ModelDataSourceBuilder
sourcepub fn s3_uri(self, input: impl Into<String>) -> Self
pub fn s3_uri(self, input: impl Into<String>) -> Self
Specifies the S3 path of ML model data to deploy.
This field is required.sourcepub fn set_s3_uri(self, input: Option<String>) -> Self
pub fn set_s3_uri(self, input: Option<String>) -> Self
Specifies the S3 path of ML model data to deploy.
sourcepub fn get_s3_uri(&self) -> &Option<String>
pub fn get_s3_uri(&self) -> &Option<String>
Specifies the S3 path of ML model data to deploy.
sourcepub fn s3_data_type(self, input: S3ModelDataType) -> Self
pub fn s3_data_type(self, input: S3ModelDataType) -> Self
Specifies the type of ML model data to deploy.
If you choose S3Prefix
, S3Uri
identifies a key name prefix. SageMaker uses all objects that match the specified key name prefix as part of the ML model data to deploy. A valid key name prefix identified by S3Uri
always ends with a forward slash (/).
If you choose S3Object
, S3Uri
identifies an object that is the ML model data to deploy.
sourcepub fn set_s3_data_type(self, input: Option<S3ModelDataType>) -> Self
pub fn set_s3_data_type(self, input: Option<S3ModelDataType>) -> Self
Specifies the type of ML model data to deploy.
If you choose S3Prefix
, S3Uri
identifies a key name prefix. SageMaker uses all objects that match the specified key name prefix as part of the ML model data to deploy. A valid key name prefix identified by S3Uri
always ends with a forward slash (/).
If you choose S3Object
, S3Uri
identifies an object that is the ML model data to deploy.
sourcepub fn get_s3_data_type(&self) -> &Option<S3ModelDataType>
pub fn get_s3_data_type(&self) -> &Option<S3ModelDataType>
Specifies the type of ML model data to deploy.
If you choose S3Prefix
, S3Uri
identifies a key name prefix. SageMaker uses all objects that match the specified key name prefix as part of the ML model data to deploy. A valid key name prefix identified by S3Uri
always ends with a forward slash (/).
If you choose S3Object
, S3Uri
identifies an object that is the ML model data to deploy.
sourcepub fn compression_type(self, input: ModelCompressionType) -> Self
pub fn compression_type(self, input: ModelCompressionType) -> Self
Specifies how the ML model data is prepared.
If you choose Gzip
and choose S3Object
as the value of S3DataType
, S3Uri
identifies an object that is a gzip-compressed TAR archive. SageMaker will attempt to decompress and untar the object during model deployment.
If you choose None
and chooose S3Object
as the value of S3DataType
, S3Uri
identifies an object that represents an uncompressed ML model to deploy.
If you choose None and choose S3Prefix
as the value of S3DataType
, S3Uri
identifies a key name prefix, under which all objects represents the uncompressed ML model to deploy.
If you choose None, then SageMaker will follow rules below when creating model data files under /opt/ml/model directory for use by your inference code:
-
If you choose
S3Object
as the value ofS3DataType
, then SageMaker will split the key of the S3 object referenced byS3Uri
by slash (/), and use the last part as the filename of the file holding the content of the S3 object. -
If you choose
S3Prefix
as the value ofS3DataType
, then for each S3 object under the key name pefix referenced byS3Uri
, SageMaker will trim its key by the prefix, and use the remainder as the path (relative to/opt/ml/model
) of the file holding the content of the S3 object. SageMaker will split the remainder by slash (/), using intermediate parts as directory names and the last part as filename of the file holding the content of the S3 object. -
Do not use any of the following as file names or directory names:
-
An empty or blank string
-
A string which contains null bytes
-
A string longer than 255 bytes
-
A single dot (
.
) -
A double dot (
..
)
-
-
Ambiguous file names will result in model deployment failure. For example, if your uncompressed ML model consists of two S3 objects
s3://mybucket/model/weights
ands3://mybucket/model/weights/part1
and you specifys3://mybucket/model/
as the value ofS3Uri
andS3Prefix
as the value ofS3DataType
, then it will result in name clash between/opt/ml/model/weights
(a regular file) and/opt/ml/model/weights/
(a directory). -
Do not organize the model artifacts in S3 console using folders. When you create a folder in S3 console, S3 creates a 0-byte object with a key set to the folder name you provide. They key of the 0-byte object ends with a slash (/) which violates SageMaker restrictions on model artifact file names, leading to model deployment failure.
sourcepub fn set_compression_type(self, input: Option<ModelCompressionType>) -> Self
pub fn set_compression_type(self, input: Option<ModelCompressionType>) -> Self
Specifies how the ML model data is prepared.
If you choose Gzip
and choose S3Object
as the value of S3DataType
, S3Uri
identifies an object that is a gzip-compressed TAR archive. SageMaker will attempt to decompress and untar the object during model deployment.
If you choose None
and chooose S3Object
as the value of S3DataType
, S3Uri
identifies an object that represents an uncompressed ML model to deploy.
If you choose None and choose S3Prefix
as the value of S3DataType
, S3Uri
identifies a key name prefix, under which all objects represents the uncompressed ML model to deploy.
If you choose None, then SageMaker will follow rules below when creating model data files under /opt/ml/model directory for use by your inference code:
-
If you choose
S3Object
as the value ofS3DataType
, then SageMaker will split the key of the S3 object referenced byS3Uri
by slash (/), and use the last part as the filename of the file holding the content of the S3 object. -
If you choose
S3Prefix
as the value ofS3DataType
, then for each S3 object under the key name pefix referenced byS3Uri
, SageMaker will trim its key by the prefix, and use the remainder as the path (relative to/opt/ml/model
) of the file holding the content of the S3 object. SageMaker will split the remainder by slash (/), using intermediate parts as directory names and the last part as filename of the file holding the content of the S3 object. -
Do not use any of the following as file names or directory names:
-
An empty or blank string
-
A string which contains null bytes
-
A string longer than 255 bytes
-
A single dot (
.
) -
A double dot (
..
)
-
-
Ambiguous file names will result in model deployment failure. For example, if your uncompressed ML model consists of two S3 objects
s3://mybucket/model/weights
ands3://mybucket/model/weights/part1
and you specifys3://mybucket/model/
as the value ofS3Uri
andS3Prefix
as the value ofS3DataType
, then it will result in name clash between/opt/ml/model/weights
(a regular file) and/opt/ml/model/weights/
(a directory). -
Do not organize the model artifacts in S3 console using folders. When you create a folder in S3 console, S3 creates a 0-byte object with a key set to the folder name you provide. They key of the 0-byte object ends with a slash (/) which violates SageMaker restrictions on model artifact file names, leading to model deployment failure.
sourcepub fn get_compression_type(&self) -> &Option<ModelCompressionType>
pub fn get_compression_type(&self) -> &Option<ModelCompressionType>
Specifies how the ML model data is prepared.
If you choose Gzip
and choose S3Object
as the value of S3DataType
, S3Uri
identifies an object that is a gzip-compressed TAR archive. SageMaker will attempt to decompress and untar the object during model deployment.
If you choose None
and chooose S3Object
as the value of S3DataType
, S3Uri
identifies an object that represents an uncompressed ML model to deploy.
If you choose None and choose S3Prefix
as the value of S3DataType
, S3Uri
identifies a key name prefix, under which all objects represents the uncompressed ML model to deploy.
If you choose None, then SageMaker will follow rules below when creating model data files under /opt/ml/model directory for use by your inference code:
-
If you choose
S3Object
as the value ofS3DataType
, then SageMaker will split the key of the S3 object referenced byS3Uri
by slash (/), and use the last part as the filename of the file holding the content of the S3 object. -
If you choose
S3Prefix
as the value ofS3DataType
, then for each S3 object under the key name pefix referenced byS3Uri
, SageMaker will trim its key by the prefix, and use the remainder as the path (relative to/opt/ml/model
) of the file holding the content of the S3 object. SageMaker will split the remainder by slash (/), using intermediate parts as directory names and the last part as filename of the file holding the content of the S3 object. -
Do not use any of the following as file names or directory names:
-
An empty or blank string
-
A string which contains null bytes
-
A string longer than 255 bytes
-
A single dot (
.
) -
A double dot (
..
)
-
-
Ambiguous file names will result in model deployment failure. For example, if your uncompressed ML model consists of two S3 objects
s3://mybucket/model/weights
ands3://mybucket/model/weights/part1
and you specifys3://mybucket/model/
as the value ofS3Uri
andS3Prefix
as the value ofS3DataType
, then it will result in name clash between/opt/ml/model/weights
(a regular file) and/opt/ml/model/weights/
(a directory). -
Do not organize the model artifacts in S3 console using folders. When you create a folder in S3 console, S3 creates a 0-byte object with a key set to the folder name you provide. They key of the 0-byte object ends with a slash (/) which violates SageMaker restrictions on model artifact file names, leading to model deployment failure.
sourcepub fn model_access_config(self, input: ModelAccessConfig) -> Self
pub fn model_access_config(self, input: ModelAccessConfig) -> Self
Specifies the access configuration file for the ML model. You can explicitly accept the model end-user license agreement (EULA) within the ModelAccessConfig
. You are responsible for reviewing and complying with any applicable license terms and making sure they are acceptable for your use case before downloading or using a model.
sourcepub fn set_model_access_config(self, input: Option<ModelAccessConfig>) -> Self
pub fn set_model_access_config(self, input: Option<ModelAccessConfig>) -> Self
Specifies the access configuration file for the ML model. You can explicitly accept the model end-user license agreement (EULA) within the ModelAccessConfig
. You are responsible for reviewing and complying with any applicable license terms and making sure they are acceptable for your use case before downloading or using a model.
sourcepub fn get_model_access_config(&self) -> &Option<ModelAccessConfig>
pub fn get_model_access_config(&self) -> &Option<ModelAccessConfig>
Specifies the access configuration file for the ML model. You can explicitly accept the model end-user license agreement (EULA) within the ModelAccessConfig
. You are responsible for reviewing and complying with any applicable license terms and making sure they are acceptable for your use case before downloading or using a model.
sourcepub fn hub_access_config(self, input: InferenceHubAccessConfig) -> Self
pub fn hub_access_config(self, input: InferenceHubAccessConfig) -> Self
Configuration information for hub access.
sourcepub fn set_hub_access_config(
self,
input: Option<InferenceHubAccessConfig>,
) -> Self
pub fn set_hub_access_config( self, input: Option<InferenceHubAccessConfig>, ) -> Self
Configuration information for hub access.
sourcepub fn get_hub_access_config(&self) -> &Option<InferenceHubAccessConfig>
pub fn get_hub_access_config(&self) -> &Option<InferenceHubAccessConfig>
Configuration information for hub access.
sourcepub fn build(self) -> S3ModelDataSource
pub fn build(self) -> S3ModelDataSource
Consumes the builder and constructs a S3ModelDataSource
.
Trait Implementations§
source§impl Clone for S3ModelDataSourceBuilder
impl Clone for S3ModelDataSourceBuilder
source§fn clone(&self) -> S3ModelDataSourceBuilder
fn clone(&self) -> S3ModelDataSourceBuilder
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for S3ModelDataSourceBuilder
impl Debug for S3ModelDataSourceBuilder
source§impl Default for S3ModelDataSourceBuilder
impl Default for S3ModelDataSourceBuilder
source§fn default() -> S3ModelDataSourceBuilder
fn default() -> S3ModelDataSourceBuilder
source§impl PartialEq for S3ModelDataSourceBuilder
impl PartialEq for S3ModelDataSourceBuilder
impl StructuralPartialEq for S3ModelDataSourceBuilder
Auto Trait Implementations§
impl Freeze for S3ModelDataSourceBuilder
impl RefUnwindSafe for S3ModelDataSourceBuilder
impl Send for S3ModelDataSourceBuilder
impl Sync for S3ModelDataSourceBuilder
impl Unpin for S3ModelDataSourceBuilder
impl UnwindSafe for S3ModelDataSourceBuilder
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more