/AWS1/IF_BDK=>CREATEMODELCUSTOMIZATIONJOB()¶
About CreateModelCustomizationJob¶
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.
Method Signature¶
METHODS /AWS1/IF_BDK~CREATEMODELCUSTOMIZATIONJOB
IMPORTING
!IV_JOBNAME TYPE /AWS1/BDKJOBNAME OPTIONAL
!IV_CUSTOMMODELNAME TYPE /AWS1/BDKCUSTOMMODELNAME OPTIONAL
!IV_ROLEARN TYPE /AWS1/BDKROLEARN OPTIONAL
!IV_CLIENTREQUESTTOKEN TYPE /AWS1/BDKIDEMPOTENCYTOKEN OPTIONAL
!IV_BASEMODELIDENTIFIER TYPE /AWS1/BDKBASEMODELIDENTIFIER OPTIONAL
!IV_CUSTOMIZATIONTYPE TYPE /AWS1/BDKCUSTOMIZATIONTYPE OPTIONAL
!IV_CUSTOMMODELKMSKEYID TYPE /AWS1/BDKKMSKEYID OPTIONAL
!IT_JOBTAGS TYPE /AWS1/CL_BDKTAG=>TT_TAGLIST OPTIONAL
!IT_CUSTOMMODELTAGS TYPE /AWS1/CL_BDKTAG=>TT_TAGLIST OPTIONAL
!IO_TRAININGDATACONFIG TYPE REF TO /AWS1/CL_BDKTRAININGDATACONFIG OPTIONAL
!IO_VALIDATIONDATACONFIG TYPE REF TO /AWS1/CL_BDKVALIDATIONDATACFG OPTIONAL
!IO_OUTPUTDATACONFIG TYPE REF TO /AWS1/CL_BDKOUTPUTDATACONFIG OPTIONAL
!IT_HYPERPARAMETERS TYPE /AWS1/CL_BDKMDELCUSTIZATIONH00=>TT_MODELCUSTIZATIONHYPERPARAMS OPTIONAL
!IO_VPCCONFIG TYPE REF TO /AWS1/CL_BDKVPCCONFIG OPTIONAL
!IO_CUSTOMIZATIONCONFIG TYPE REF TO /AWS1/CL_BDKCUSTOMIZATIONCFG OPTIONAL
RETURNING
VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_bdkcremdelcustizati01
RAISING
/AWS1/CX_BDKACCESSDENIEDEX
/AWS1/CX_BDKCONFLICTEXCEPTION
/AWS1/CX_BDKINTERNALSERVEREX
/AWS1/CX_BDKRESOURCENOTFOUNDEX
/AWS1/CX_BDKSERVICEQUOTAEXCDEX
/AWS1/CX_BDKTHROTTLINGEX
/AWS1/CX_BDKTOOMANYTAGSEX
/AWS1/CX_BDKVALIDATIONEX
/AWS1/CX_BDKCLIENTEXC
/AWS1/CX_BDKSERVEREXC
/AWS1/CX_RT_TECHNICAL_GENERIC
/AWS1/CX_RT_SERVICE_GENERIC.
IMPORTING¶
Required arguments:¶
iv_jobname TYPE /AWS1/BDKJOBNAME /AWS1/BDKJOBNAME¶
A name for the fine-tuning job.
iv_custommodelname TYPE /AWS1/BDKCUSTOMMODELNAME /AWS1/BDKCUSTOMMODELNAME¶
A name for the resulting custom model.
iv_rolearn TYPE /AWS1/BDKROLEARN /AWS1/BDKROLEARN¶
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.
iv_basemodelidentifier TYPE /AWS1/BDKBASEMODELIDENTIFIER /AWS1/BDKBASEMODELIDENTIFIER¶
Name of the base model.
io_trainingdataconfig TYPE REF TO /AWS1/CL_BDKTRAININGDATACONFIG /AWS1/CL_BDKTRAININGDATACONFIG¶
Information about the training dataset.
io_outputdataconfig TYPE REF TO /AWS1/CL_BDKOUTPUTDATACONFIG /AWS1/CL_BDKOUTPUTDATACONFIG¶
S3 location for the output data.
Optional arguments:¶
iv_clientrequesttoken TYPE /AWS1/BDKIDEMPOTENCYTOKEN /AWS1/BDKIDEMPOTENCYTOKEN¶
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.
iv_customizationtype TYPE /AWS1/BDKCUSTOMIZATIONTYPE /AWS1/BDKCUSTOMIZATIONTYPE¶
The customization type.
iv_custommodelkmskeyid TYPE /AWS1/BDKKMSKEYID /AWS1/BDKKMSKEYID¶
The custom model is encrypted at rest using this key.
it_jobtags TYPE /AWS1/CL_BDKTAG=>TT_TAGLIST TT_TAGLIST¶
Tags to attach to the job.
it_custommodeltags TYPE /AWS1/CL_BDKTAG=>TT_TAGLIST TT_TAGLIST¶
Tags to attach to the resulting custom model.
io_validationdataconfig TYPE REF TO /AWS1/CL_BDKVALIDATIONDATACFG /AWS1/CL_BDKVALIDATIONDATACFG¶
Information about the validation dataset.
it_hyperparameters TYPE /AWS1/CL_BDKMDELCUSTIZATIONH00=>TT_MODELCUSTIZATIONHYPERPARAMS TT_MODELCUSTIZATIONHYPERPARAMS¶
Parameters related to tuning the model. For details on the format for different models, see Custom model hyperparameters.
io_vpcconfig TYPE REF TO /AWS1/CL_BDKVPCCONFIG /AWS1/CL_BDKVPCCONFIG¶
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.
io_customizationconfig TYPE REF TO /AWS1/CL_BDKCUSTOMIZATIONCFG /AWS1/CL_BDKCUSTOMIZATIONCFG¶
The customization configuration for the model customization job.
RETURNING¶
oo_output TYPE REF TO /aws1/cl_bdkcremdelcustizati01 /AWS1/CL_BDKCREMDELCUSTIZATI01¶
Domain /AWS1/RT_ACCOUNT_ID Primitive Type NUMC
Examples¶
Syntax Example¶
This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.
DATA(lo_result) = lo_client->createmodelcustomizationjob(
io_customizationconfig = new /aws1/cl_bdkcustomizationcfg(
io_distillationconfig = new /aws1/cl_bdkdistillationconfig(
io_teachermodelconfig = new /aws1/cl_bdkteachermodelconfig(
iv_maxrsplengthforinference = 123
iv_teachermodelidentifier = |string|
)
)
io_rftconfig = new /aws1/cl_bdkrftconfig(
io_graderconfig = new /aws1/cl_bdkgraderconfig( new /aws1/cl_bdklambdagraderconfig( |string| ) )
io_hyperparameters = new /aws1/cl_bdkrfthyperparameters(
iv_batchsize = 123
iv_epochcount = 123
iv_evalinterval = 123
iv_inferencemaxtokens = 123
iv_learningrate = '0.1'
iv_maxpromptlength = 123
iv_reasoningeffort = |string|
iv_trainingsampleperprompt = 123
)
)
)
io_outputdataconfig = new /aws1/cl_bdkoutputdataconfig( |string| )
io_trainingdataconfig = new /aws1/cl_bdktrainingdataconfig(
io_invocationlogsconfig = new /aws1/cl_bdkinvclogsconfig(
io_invocationlogsource = new /aws1/cl_bdkinvclogsource( |string| )
io_requestmetadatafilters = new /aws1/cl_bdkrequestmetfilters(
it_andall = VALUE /aws1/cl_bdkreqmetbasefilters=>tt_requestmetadatafilterslist(
(
new /aws1/cl_bdkreqmetbasefilters(
it_equals = VALUE /aws1/cl_bdkrequestmetmap_w=>tt_requestmetadatamap(
(
VALUE /aws1/cl_bdkrequestmetmap_w=>ts_requestmetadatamap_maprow(
key = |string|
value = new /aws1/cl_bdkrequestmetmap_w( |string| )
)
)
)
it_notequals = VALUE /aws1/cl_bdkrequestmetmap_w=>tt_requestmetadatamap(
(
VALUE /aws1/cl_bdkrequestmetmap_w=>ts_requestmetadatamap_maprow(
key = |string|
value = new /aws1/cl_bdkrequestmetmap_w( |string| )
)
)
)
)
)
)
it_equals = VALUE /aws1/cl_bdkrequestmetmap_w=>tt_requestmetadatamap(
(
VALUE /aws1/cl_bdkrequestmetmap_w=>ts_requestmetadatamap_maprow(
key = |string|
value = new /aws1/cl_bdkrequestmetmap_w( |string| )
)
)
)
it_notequals = VALUE /aws1/cl_bdkrequestmetmap_w=>tt_requestmetadatamap(
(
VALUE /aws1/cl_bdkrequestmetmap_w=>ts_requestmetadatamap_maprow(
key = |string|
value = new /aws1/cl_bdkrequestmetmap_w( |string| )
)
)
)
it_orall = VALUE /aws1/cl_bdkreqmetbasefilters=>tt_requestmetadatafilterslist(
(
new /aws1/cl_bdkreqmetbasefilters(
it_equals = VALUE /aws1/cl_bdkrequestmetmap_w=>tt_requestmetadatamap(
(
VALUE /aws1/cl_bdkrequestmetmap_w=>ts_requestmetadatamap_maprow(
key = |string|
value = new /aws1/cl_bdkrequestmetmap_w( |string| )
)
)
)
it_notequals = VALUE /aws1/cl_bdkrequestmetmap_w=>tt_requestmetadatamap(
(
VALUE /aws1/cl_bdkrequestmetmap_w=>ts_requestmetadatamap_maprow(
key = |string|
value = new /aws1/cl_bdkrequestmetmap_w( |string| )
)
)
)
)
)
)
)
iv_usepromptresponse = ABAP_TRUE
)
iv_s3uri = |string|
)
io_validationdataconfig = new /aws1/cl_bdkvalidationdatacfg(
it_validators = VALUE /aws1/cl_bdkvalidator=>tt_validators(
( new /aws1/cl_bdkvalidator( |string| ) )
)
)
io_vpcconfig = new /aws1/cl_bdkvpcconfig(
it_securitygroupids = VALUE /aws1/cl_bdksecuritygroupids_w=>tt_securitygroupids(
( new /aws1/cl_bdksecuritygroupids_w( |string| ) )
)
it_subnetids = VALUE /aws1/cl_bdksubnetids_w=>tt_subnetids(
( new /aws1/cl_bdksubnetids_w( |string| ) )
)
)
it_custommodeltags = VALUE /aws1/cl_bdktag=>tt_taglist(
(
new /aws1/cl_bdktag(
iv_key = |string|
iv_value = |string|
)
)
)
it_hyperparameters = VALUE /aws1/cl_bdkmdelcustizationh00=>tt_modelcustizationhyperparams(
(
VALUE /aws1/cl_bdkmdelcustizationh00=>ts_mdelcustizationhyp00_maprow(
value = new /aws1/cl_bdkmdelcustizationh00( |string| )
key = |string|
)
)
)
it_jobtags = VALUE /aws1/cl_bdktag=>tt_taglist(
(
new /aws1/cl_bdktag(
iv_key = |string|
iv_value = |string|
)
)
)
iv_basemodelidentifier = |string|
iv_clientrequesttoken = |string|
iv_customizationtype = |string|
iv_custommodelkmskeyid = |string|
iv_custommodelname = |string|
iv_jobname = |string|
iv_rolearn = |string|
).
This is an example of reading all possible response values
lo_result = lo_result.
IF lo_result IS NOT INITIAL.
lv_modelcustomizationjobar = lo_result->get_jobarn( ).
ENDIF.