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
8929 8930 8931 8932 8933 8934 8935 8936 8937 8938 8939 8940 8941 8942 8943 8944 8945 8946 8947 8948 8949 8950 8951 8952 8953 8954 8955 8956 8957 8958 8959 8960 8961 8962 8963 8964 8965 8966 8967 8968 8969 8970 8971 8972 8973 8974 8975 8976 8977 8978 8979 8980 8981 8982 8983 8984 8985 8986 8987 8988 8989 8990 8991 8992 8993 8994 8995 8996 8997 8998 8999 9000 9001 9002 9003 9004 9005 9006 9007 9008 9009 9010 9011 9012 9013 9014 9015 9016 9017 9018 9019 9020 9021 9022 9023 9024 9025 9026 9027 9028 9029 9030 9031 9032 9033 9034 9035 9036 9037 9038 9039 9040 9041 9042 9043 9044 9045 9046 9047 9048 9049 9050 9051 9052 9053 | |