JumpStartModelsCache: Class that implements a cache for JumpStart models manifests...

JumpStartModelsCacheR Documentation

Class that implements a cache for JumpStart models manifests and specs.

Description

The manifest and specs associated with JumpStart models provide the information necessary for launching JumpStart models from the SageMaker SDK.

Methods

Public methods


Method new()

Initialize a “JumpStartModelsCache“ instance.

Usage
JumpStartModelsCache$new(
  region = JUMPSTART_DEFAULT_REGION_NAME(),
  max_s3_cache_items = JUMPSTART_DEFAULT_MAX_S3_CACHE_ITEMS,
  s3_cache_expiration_horizon = JUMPSTART_DEFAULT_S3_CACHE_EXPIRATION_HORIZON,
  max_semantic_version_cache_items = JUMPSTART_DEFAULT_MAX_SEMANTIC_VERSION_CACHE_ITEMS,
 
    semantic_version_cache_expiration_horizon = JUMPSTART_DEFAULT_SEMANTIC_VERSION_CACHE_EXPIRATION_HORIZON,
  manifest_file_s3_key = JUMPSTART_DEFAULT_MANIFEST_FILE_S3_KEY,
  s3_bucket_name = NULL
)
Arguments
region

(str): AWS region to associate with cache. Default: region associated with boto3 session.

max_s3_cache_items

(int): Maximum number of items to store in s3 cache. Default: 20.

s3_cache_expiration_horizon

(datetime.timedelta): Maximum time to hold items in s3 cache before invalidation. Default: 6 hours.

max_semantic_version_cache_items

(int): Maximum number of items to store in semantic version cache. Default: 20.

semantic_version_cache_expiration_horizon

(datetime.timedelta): Maximum time to hold items in semantic version cache before invalidation. Default: 6 hours.

manifest_file_s3_key

(str): The key in S3 corresponding to the sdk metadata manifest.

s3_bucket_name

(Optional[str]): S3 bucket to associate with cache. Default: JumpStart-hosted content bucket for region.


Method set_region()

Set region for cache. Clears cache after new region is set.

Usage
JumpStartModelsCache$set_region(region)
Arguments
region

AWS region to associate with cache.


Method get_region()

Return region for cache.

Usage
JumpStartModelsCache$get_region()

Method set_manifest_file_s3_key()

Set manifest file s3 key. Clears cache after new key is set.

Usage
JumpStartModelsCache$set_manifest_file_s3_key(key)
Arguments
key

(str): The key in S3 corresponding to the sdk metadata manifest.


Method get_manifest_file_s3_key()

Return manifest file s3 key for cache.

Usage
JumpStartModelsCache$get_manifest_file_s3_key()

Method set_s3_bucket_name()

Set s3 bucket used for cache.

Usage
JumpStartModelsCache$set_s3_bucket_name()
Arguments
s3_bucket_name

(str): S3 bucket to associate with cache.


Method get_bucket()

Return bucket used for cache.

Usage
JumpStartModelsCache$get_bucket()

Method get_manifest()

Return entire JumpStart models manifest.

Usage
JumpStartModelsCache$get_manifest()

Method get_header()

Return header for a given JumpStart model ID and semantic version.

Usage
JumpStartModelsCache$get_header()
Arguments
model_id

(str): model ID for which to get a header.

semantic_version_str

(str): The semantic version for which to get a header.


Method get_specs()

Return specs for a given JumpStart model ID and semantic version.

Usage
JumpStartModelsCache$get_specs()
Arguments
model_id

(str): model ID for which to get specs.

semantic_version_str

(str): The semantic version for which to get specs.


Method clear()

Clears the model ID/version and s3 cache.

Usage
JumpStartModelsCache$clear()

Method clone()

The objects of this class are cloneable with this method.

Usage
JumpStartModelsCache$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


DyfanJones/sagemaker-r-local documentation built on June 14, 2022, 10:32 p.m.