create_model_customization_job
¶
create_model_customization_job(
job_name: JobName,
custom_model_name: CustomModelName,
role_arn: RoleArn,
base_model_identifier: BaseModelIdentifier,
training_data_config: TrainingDataConfig,
output_data_config: OutputDataConfig,
*,
config_overrides: Optional[BedrockClientConfig] = None,
client_request_token: Optional[IdempotencyToken] = None,
customization_type: Optional[CustomizationType] = None,
custom_model_kms_key_id: Optional[KmsKeyId] = None,
job_tags: Optional[TagList] = None,
custom_model_tags: Optional[TagList] = None,
validation_data_config: Optional[ValidationDataConfig] = None,
hyper_parameters: Optional[ModelCustomizationHyperParameters] = None,
vpc_config: Optional[VpcConfig] = None,
customization_config: Optional[CustomizationConfig] = None,
) -> CreateModelCustomizationJobResponse
Creates a fine-tuning job to customize a base model.
You specify the base foundation model and the location of the training data. After the model-customization job completes successfully, your custom model resource will be ready to use. Amazon Bedrock returns validation loss metrics and output generations after the job completes.
For information on the format of training and validation data, see Prepare the datasets.
Model-customization jobs are asynchronous and the completion time depends on the base model and the training/validation data size. To monitor a job, use the GetModelCustomizationJob operation to retrieve the job status.
For more information, see Custom models in the Amazon Bedrock User Guide.
Parameters:
-
job_name(JobName) –A name for the fine-tuning job.
-
custom_model_name(CustomModelName) –A name for the resulting custom model.
-
role_arn(RoleArn) –The Amazon Resource Name (ARN) of an IAM service role that Amazon Bedrock can assume to perform tasks on your behalf. For example, during model training, Amazon Bedrock needs your permission to read input data from an S3 bucket, write model artifacts to an S3 bucket. To pass this role to Amazon Bedrock, the caller of this API must have the
iam:PassRolepermission. -
client_request_token(Optional[IdempotencyToken], default:None) –A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error. For more information, see Ensuring idempotency.
-
base_model_identifier(BaseModelIdentifier) –Name of the base model.
-
customization_type(Optional[CustomizationType], default:None) –The customization type.
-
custom_model_kms_key_id(Optional[KmsKeyId], default:None) –The custom model is encrypted at rest using this key.
-
job_tags(Optional[TagList], default:None) –Tags to attach to the job.
-
custom_model_tags(Optional[TagList], default:None) –Tags to attach to the resulting custom model.
-
training_data_config(TrainingDataConfig) –Information about the training dataset.
-
validation_data_config(Optional[ValidationDataConfig], default:None) –Information about the validation dataset.
-
output_data_config(OutputDataConfig) –S3 location for the output data.
-
hyper_parameters(Optional[ModelCustomizationHyperParameters], default:None) –Parameters related to tuning the model. For details on the format for different models, see Custom model hyperparameters.
-
vpc_config(Optional[VpcConfig], default:None) –The configuration of the Virtual Private Cloud (VPC) that contains the resources that you're using for this job. For more information, see Protect your model customization jobs using a VPC.
-
customization_config(Optional[CustomizationConfig], default:None) –The customization configuration for the model customization job.
Raises:
-
AccessDeniedException–The request is denied because of missing access permissions.
-
ConflictException–Error occurred because of a conflict while performing an operation.
-
InternalServerException–An internal server error occurred. Retry your request.
-
ResourceNotFoundException–The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
-
ServiceQuotaExceededException–The number of requests exceeds the service quota. Resubmit your request later.
-
ThrottlingException–The number of requests exceeds the limit. Resubmit your request later.
-
TooManyTagsException–The request contains more tags than can be associated with a resource (50 tags per resource). The maximum number of tags includes both existing tags and those included in your current request.
-
ValidationException–Input validation failed. Check your request parameters and retry the request.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_bedrock/_services/bedrock.py
7967 7968 7969 7970 7971 7972 7973 7974 7975 7976 7977 7978 7979 7980 7981 7982 7983 7984 7985 7986 7987 7988 7989 7990 7991 7992 7993 7994 7995 7996 7997 7998 7999 8000 8001 8002 8003 8004 8005 8006 8007 8008 8009 8010 8011 8012 8013 8014 8015 8016 8017 8018 8019 8020 8021 8022 8023 8024 8025 8026 8027 8028 8029 8030 8031 8032 8033 8034 8035 8036 8037 8038 8039 8040 8041 8042 8043 8044 8045 8046 8047 8048 8049 8050 8051 8052 8053 8054 8055 8056 8057 8058 8059 8060 8061 8062 8063 8064 8065 8066 8067 8068 8069 8070 8071 8072 8073 8074 8075 8076 8077 8078 8079 8080 8081 8082 8083 8084 8085 8086 8087 8088 8089 8090 8091 | |