create_model_customization_job
async
¶
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[AsyncBedrockClientConfig] = 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/async_bedrock.py
9045 9046 9047 9048 9049 9050 9051 9052 9053 9054 9055 9056 9057 9058 9059 9060 9061 9062 9063 9064 9065 9066 9067 9068 9069 9070 9071 9072 9073 9074 9075 9076 9077 9078 9079 9080 9081 9082 9083 9084 9085 9086 9087 9088 9089 9090 9091 9092 9093 9094 9095 9096 9097 9098 9099 9100 9101 9102 9103 9104 9105 9106 9107 9108 9109 9110 9111 9112 9113 9114 9115 9116 9117 9118 9119 9120 9121 9122 9123 9124 9125 9126 9127 9128 9129 9130 9131 9132 9133 9134 9135 9136 9137 9138 9139 9140 9141 9142 9143 9144 9145 9146 9147 9148 9149 9150 9151 9152 9153 9154 9155 9156 9157 9158 9159 9160 9161 9162 9163 9164 9165 9166 9167 9168 9169 9170 | |