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
8470 8471 8472 8473 8474 8475 8476 8477 8478 8479 8480 8481 8482 8483 8484 8485 8486 8487 8488 8489 8490 8491 8492 8493 8494 8495 8496 8497 8498 8499 8500 8501 8502 8503 8504 8505 8506 8507 8508 8509 8510 8511 8512 8513 8514 8515 8516 8517 8518 8519 8520 8521 8522 8523 8524 8525 8526 8527 8528 8529 8530 8531 8532 8533 8534 8535 8536 8537 8538 8539 8540 8541 8542 8543 8544 8545 8546 8547 8548 8549 8550 8551 | |