sagemaker.core.jumpstart.session_utils

sagemaker.core.jumpstart.session_utils#

This module stores SageMaker Session utilities for JumpStart models.

Functions

get_model_info_from_endpoint(endpoint_name)

Optionally inference component names, return the model ID, version and config name.

get_model_info_from_training_job(...[, ...])

Returns the model ID and version and config name inferred from a training job.

sagemaker.core.jumpstart.session_utils.get_model_info_from_endpoint(endpoint_name: str, inference_component_name: str | None = None, sagemaker_session: ~sagemaker.core.helper.session_helper.Session = <sagemaker.core.helper.session_helper.Session object>) Tuple[str, str, str | None, str | None, str | None][source]#

Optionally inference component names, return the model ID, version and config name.

Infers the model ID and version based on the resource tags. Returns a tuple of the model ID and version. A third string element is included in the tuple for any inferred inference component name, or ‘None’ if it’s a model-based endpoint.

JumpStart adds tags automatically to endpoints, models, endpoint configs, and inference components launched in SageMaker Studio and programmatically with the SageMaker Python SDK.

Raises:

ValueError – If model ID and version cannot be inferred from the endpoint.

sagemaker.core.jumpstart.session_utils.get_model_info_from_training_job(training_job_name: str, sagemaker_session: ~sagemaker.core.helper.session_helper.Session | None = <sagemaker.core.helper.session_helper.Session object>) Tuple[str, str, str | None, str | None][source]#

Returns the model ID and version and config name inferred from a training job.

Raises:

ValueError – If the training job does not have tags from which the model ID and version can be inferred. JumpStart adds tags automatically to training jobs launched in SageMaker Studio and programmatically with the SageMaker Python SDK.