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
8069 8070 8071 8072 8073 8074 8075 8076 8077 8078 8079 8080 8081 8082 8083 8084 8085 8086 8087 8088 8089 8090 8091 8092 8093 8094 8095 8096 8097 8098 8099 8100 8101 8102 8103 8104 8105 8106 8107 8108 8109 8110 8111 8112 8113 8114 8115 8116 8117 8118 8119 8120 8121 8122 8123 8124 8125 8126 8127 8128 8129 8130 8131 8132 8133 8134 8135 8136 8137 8138 8139 8140 8141 8142 8143 8144 8145 8146 8147 8148 8149 8150 8151 8152 8153 8154 8155 8156 8157 8158 8159 8160 8161 8162 8163 8164 8165 8166 8167 8168 8169 8170 8171 8172 8173 8174 8175 8176 8177 8178 8179 8180 8181 8182 8183 8184 8185 8186 8187 8188 8189 8190 8191 8192 8193 8194 | |