create_training_session
¶
create_training_session(
*,
config_overrides: Optional[SageMakerClientConfig] = None,
training_session_name: Optional[TrainingSessionName] = None,
model_package_group_arn: Optional[ModelPackageGroupArn] = None,
lora_config: Optional[LoraConfig] = None,
role_arn: Optional[RoleArn] = None,
vpc_config: Optional[VpcConfig] = None,
model_config: Optional[TrainingSessionModelConfig] = None,
output_config: Optional[TrainingSessionOutputConfig] = None,
tags: Optional[TagList] = None,
) -> CreateTrainingSessionResponse
Creates a training session in Amazon SageMaker. A training session provisions compute resources for fine-tuning a foundation model using Low-Rank Adaptation (LoRA). After the session is created, you can submit training operations and sample inference requests through the Amazon SageMaker Training Session Runtime API.
The following operations are related to CreateTrainingSession:
-
DescribeTrainingSession -
ListTrainingSessions -
StopTrainingSession -
DeleteTrainingSession
Parameters:
-
training_session_name(Optional[TrainingSessionName], default:None) –The name of the training session.
-
model_package_group_arn(Optional[ModelPackageGroupArn], default:None) –The Amazon Resource Name (ARN) of the model package group where checkpoints and fine-tuned model artifacts are published.
-
lora_config(Optional[LoraConfig], default:None) –The Low-Rank Adaptation (LoRA) configuration for the training session, including the rank and alpha parameters.
-
role_arn(Optional[RoleArn], default:None) –The Amazon Resource Name (ARN) of the IAM role that Amazon SageMaker assumes to access resources on your behalf. The role must have permissions to access the output S3 path and model package group.
-
vpc_config(Optional[VpcConfig], default:None) –The Virtual Private Cloud (VPC) configuration for the training session. Specify subnets and security groups to run the training session in your VPC.
-
model_config(Optional[TrainingSessionModelConfig], default:None) –The configuration for the base model, including the model ARN and end-user license agreement (EULA) acceptance.
-
output_config(Optional[TrainingSessionOutputConfig], default:None) –The output configuration for the training session, including the S3 location and optional encryption settings.
-
tags(Optional[TagList], default:None) –An array of key-value pairs to apply to the training session as tags. For more information, see Tagging Amazon Web Services Resources.
Raises:
-
ResourceInUse–Resource being accessed is in use.
-
ResourceLimitExceeded–You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.
-
ResourceNotFound–Resource being access is not found.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_sagemaker/_services/sage_maker.py
7741 7742 7743 7744 7745 7746 7747 7748 7749 7750 7751 7752 7753 7754 7755 7756 7757 7758 7759 7760 7761 7762 7763 7764 7765 7766 7767 7768 7769 7770 7771 7772 7773 7774 7775 7776 7777 7778 7779 7780 7781 7782 7783 7784 7785 7786 7787 7788 7789 7790 7791 7792 7793 7794 7795 7796 7797 7798 7799 7800 7801 7802 7803 7804 7805 7806 7807 7808 7809 7810 7811 7812 7813 7814 7815 7816 7817 7818 7819 7820 7821 7822 | |