sagemaker.core.jumpstart.accessors#
This module contains accessors related to SageMaker JumpStart.
Classes
Static class for storing the JumpStart models cache. |
|
Static class for storing and retrieving S3 payload artifacts. |
|
Static class for storing the SageMaker settings. |
- class sagemaker.core.jumpstart.accessors.JumpStartModelsAccessor[source]#
Bases:
objectStatic class for storing the JumpStart models cache.
- static get_jumpstart_gated_content_bucket() str | None[source]#
Returns JumpStart gated content bucket.
- static get_manifest(*args, **kwargs)#
- static get_model_header(region: str, model_id: str, version: str, model_type: JumpStartModelType = JumpStartModelType.OPEN_WEIGHTS) JumpStartModelHeader[source]#
Returns model header from JumpStart models cache.
- Parameters:
region (str) – region for which to retrieve header.
model_id (str) – model ID to retrieve.
version (str) – semantic version to retrieve for the model ID.
- static get_model_specs(region: str, model_id: str, version: str, hub_arn: str | None = None, s3_client: ~boto3.client | None = None, model_type=JumpStartModelType.OPEN_WEIGHTS, sagemaker_session: ~sagemaker.core.helper.session_helper.Session = <sagemaker.core.helper.session_helper.Session object>) JumpStartModelSpecs[source]#
Returns model specs from JumpStart models cache.
- Parameters:
region (str) – region for which to retrieve header.
model_id (str) – model ID to retrieve.
version (str) – semantic version to retrieve for the model ID.
s3_client (boto3.client) – boto3 client to use for accessing JumpStart models s3 cache. If not set, a default client will be made.
- static reset_cache(cache_kwargs: Dict[str, Any] | None = None, region: str | None = None) None[source]#
Resets cache, optionally allowing cache kwargs to be passed to the new cache.
- Raises:
ValueError – If region in cache_kwargs is inconsistent with region argument.
- Parameters:
cache_kwargs (str) – cache kwargs to validate.
region (str) – The region to validate along with the kwargs.
- static set_cache_kwargs(cache_kwargs: Dict[str, Any], region: str | None = None) None[source]#
Sets cache kwargs, clears the cache.
- Raises:
ValueError – If region in cache_kwargs is inconsistent with region argument.
- Parameters:
cache_kwargs (str) – cache kwargs to validate.
region (str) – Optional. The region to validate along with the kwargs.
- class sagemaker.core.jumpstart.accessors.JumpStartS3PayloadAccessor[source]#
Bases:
objectStatic class for storing and retrieving S3 payload artifacts.
- CACHE_SIZE = 16#
- MAX_CACHE_SIZE_BYTES = 100000000#
- MAX_PAYLOAD_SIZE_BYTES = 6000000#
- static clear_cache() None[source]#
Clears LRU caches associated with S3 client and retrieved objects.