- Print
- PDF
Create training
- Print
- PDF
The latest service changes have not yet been reflected in this content. We will update the content as soon as possible. Please refer to the Korean version for information on the latest updates.
Available in Classic and VPC
Create a training. After the training you created is complete, you can call Chat Completions API or Completions API to generate interactive sentences to see the answers CLOVA Studio generated.
Request
The following describes the request format for the endpoint. The request format is as follows:
Method | URI |
---|---|
POST | /tuning/v2/tasks |
Request headers
The following describes the request headers.
Field | Required | Description |
---|---|---|
X-NCP-APIGW-TIMESTAMP | Required | This is the number of milliseconds that have elapsed since January 1, 1970 00:00:00 UTC
|
X-NCP-IAM-ACCESS-KEY | Required | Access key issued on the NAVER Cloud Platform portal or Sub Account service |
X-NCP-APIGW-SIGNATURE-V2 | Required | Base64-encoded signature that encrypts the request path and headers with a secret key that maps to the access key, using the HMAC encryption algorithm (HmacSHA256)
|
X-NCP-CLOVASTUDIO-REQUEST-ID | Optional | Request ID for the request |
Content-Type | Required | Request data format
|
Request body
The following describes the request body.
Field | Type | Required | Description |
---|---|---|---|
name | String | Optional | Training name
|
model | String | Required | Model name to use for tuning |
tuningType | String | Optional | Tuning method
|
taskType | String | Optional | Training type
|
trainEpochs | String | Optional | Number of epochs trained on the model
|
learningRate | String | Optional | Training rate (level or degree to which model parameters are relearned when tuning)
|
trainingDatasetFilePath | String | Conditional | Path to the dataset file to train on
|
trainingDatasetBucket | String | Conditional | Name of the bucket where the dataset file to be trained is uploaded
|
trainingDatasetAccessKey | String | Conditional | Access key for accessing large dataset file to train on
|
trainingDatasetSecretKey | String | Conditional | Secret key for accessing large dataset file to train on
|
Request example
The following is a sample request.
curl --location --request POST 'https://clovastudio.apigw.ntruss.com/tuning/v2/tasks' \
--header 'X-NCP-APIGW-TIMESTAMP: {Timestamp}' \
--header 'X-NCP-IAM-ACCESS-KEY: {Access Key}' \
--header 'X-NCP-APIGW-SIGNATURE-V2: {API Gateway Signature}' \
--header 'Content-Type: multipart/form-data' \
--header 'X-NCP-CLOVASTUDIO-REQUEST-ID: {Request ID}'
--data '{
"name": "generation_task",
"model": "HCX-003",
"taskType": "GENERATION",
"trainEpochs": 8,
"learningRate": 1e-5f,
"trainingDatasetFilePath": "root_path/sub_path/file_name",
"trainingDatasetBucket": "bucket_name",
"trainingDatasetAccessKey": "access_key",
"trainingDatasetSecretKey": "secret_key"
}'
Response
The following describes the response format.
Response headers
The following describes the response headers.
Headers | Required | Description |
---|---|---|
Content-Type | - | Response data format
|
Response body
The following describes the response body.
Field | Type | Required | Description |
---|---|---|---|
result | Object | - | Response result |
result.id | String | - | Training ID |
result.name | String | - | Training name |
result.model | String | - | Tuning model name |
result.method | String | - | Tuning method
|
result.taskType | String | - | Training type
|
result.trainEpochs | Integer | - | Number of epochs trained on the model |
result.learningRate | Double | - | Training rate (level or degree to which model parameters are retrained when tuning) |
result.status | String | - | Training progress
|
result.statusInfo | Array | - | Training progress details |
result.createdClientType | String | - | Type of client requesting training
|
result.createdDate | String | - | Training creation date (ISO 8601 format) |
result.updatedDate | String | - | Training modification date (ISO 8601 format) |
statusInfo
The following describes statusInfo
.
Field | Type | Required | Description |
---|---|---|---|
label | Array | - |
|
dataRows | Integer | - | Number of data |
numOfTokens | Integer | - | Number of data tokens |
currStep | Integer | - | Number of current training steps |
totalTrainSteps | Integer | - | Number of total training steps |
currEpoch | Integer | - | Current epoch |
totalTrainEpochs | Integer | - | All training epochs |
estimatedTime | Integer | - | Estimated run time
|
trainLoss | Double | - | Training loss |
sendWeightSuccess | Boolean | - | Whether to save training results
|
failureReason | String | - | Reason for training failure (FAILED ) |
message | String | - | Detailed message for training failure (FAILED ) reason |
endDatetime | String | - | Training end date (in ISO 8601 format) |
failureReason
, message
The following describes training failure reasons (failureReason
) and the detailed message (message
) for each training failure reason.
Training failure reason | Message details | Description |
---|---|---|
file.extension | Unavailable file extension. Please check the file extension again. | The data file extension does not match the requested tuningType |
file.size | Exceeded the disk usage limit. Please check if the file size is {limit} or less. | The expected file size for the training request is exceeded |
file.encoding | Unsupported charset | Non-UTF8-sig encoding |
file.format | Invalid json format. {reason} | Unable to decode the dataset file (.json/.jsonl) |
file.format | Invalid dataset: required field empty. {column} | The dataset file does not have the required columns |
file.format | Invalid dataset: unexpected column. {column} | The dataset file has unexpected columns |
file.format | Invalid dataset: duplicate columns. {column} | The dataset file is not case sensitive and contains duplicate columns |
file.format | Invalid dataset: column order | The column order in the dataset file deviates from System_Prompt, C_ID, T_ID, Text, and Completion |
file.format | Invalid dataset: {column} | The C_ID (or T_ID) in the dataset file does not satisfy the pattern of starting at 0 and incrementing by 1, or the value is empty |
file.error | - | File read error |
resource.timeout | - | Response timeout due to GPU acquisition failure; retry required |
clops.error | - | CLOps error while training |
train.unknown | - | Non-file related error while training |
Response syntax
The following is a sample example.
Succeeded
The following is a sample response upon a successful call.
{
"status": {
"code": "20000",
"message": "OK"
},
"result": {
"id": "czf9fbky",
"name": "230821-130704",
"model": "HCX-003",
"method": "LoRA",
"taskType": "GENERATION",
"trainEpochs": 8,
"learningRate": 1.0E-4,
"status": "WAIT",
"statusInfo": {
"label": null,
"dataRows": null,
"numOfTokens": null,
"currStep": null,
"totalTrainSteps": null,
"currEpoch": null,
"totalTrainEpochs": null,
"estimatedTime": null,
"trainLoss": null,
"sendWeightSuccess": null,
"failureReason": null,
"message":null,
"endDatetime": null
},
"createdClientType": "API",
"createdDate": "2023-08-21T13:07:06+0900",
"updatedDate": "2023-08-21T13:07:06+0900"
}
}
Failure
The following is a sample response upon a failed call.