Generating training
- Print
- PDF
Generating training
- Print
- PDF
Article Summary
Share feedback
Thanks for sharing your feedback!
Available in Classic and VPC
Generates training. Once the generated training is completed, you can call the API for generating conversational sentences to see the responses generated by CLOVA Studio.
Requests
Describes the request format. The request format is as follows:
Method | URI |
---|---|
POST | /tuning/v2/tasks |
Header
The following describes the header.
Field | Required | Description |
---|---|---|
X-NCP-APIGW-TIMESTAMP | Y | Time elapsed in milliseconds since January 1, 1970, 00:00:00 UTC If the time differs from that of the API Gateway server by 5 minutes or more, then the request is considered invalid x-ncp-apigw-timestamp:{Timestamp} |
X-NCP-IAM-ACCESS-KEY | Y | Access key ID issued from NAVER Cloud Platform portal x-ncp-iam-access-key:{Main Account Access Key} |
X-NCP-APIGW-SIGNATURE-V2 | Y | Signature encrypted with the access key ID value and secret key x-ncp-apigw-signature-v2:{API Gateway Signature} |
X-NCP-CLOVASTUDIO-REQUEST-ID | N | Request ID for each request |
Content-Type | Y | multipart/form-data |
Body
The following describes the body.
Field | Type | Required | Description |
---|---|---|---|
name | string | N | Training name (default: training creation date) |
model | string | Y | Tuning model name |
tuningType | string | N | Tuning method |
taskType | string | N | Training type |
trainEpochs | string | N | Number of epochs to train the model |
learningRate | string | N | Training rate: the level or degree to which model parameters are re-trained when tuning |
trainingDataset | string | Y | Dataset file path to train on |
Syntax
The following is an example of syntax.
curl --location --request POST 'https://clovastudio.apigw.ntruss.com/tuning/v2/tasks' \
--header 'Content-Type: multipart/form-data' \
--header 'X-NCP-APIGW-TIMESTAMP: <api_gw_time>' \
--header 'X-NCP-IAM-ACCESS-KEY: <iam_access_key>' \
--header 'X-NCP-APIGW-SIGNATURE-V2: <api_gw_sig>' \
--header 'X-NCP-CLOVASTUDIO-REQUEST-ID: <request_id>' \
--form 'name="test"' \
--form 'model="HCX-002"' \
--form 'method="LoRA"' \
--form 'taskType="GENERATION"' \
--form 'trainEpochs="4"' \
--form 'learningRate="1.0E-4"' \
--form 'trainingDataset=@"E:/Downloads/test.csv"'
Responses
Describes the responses format.
Header
The following describes the header.
Header | Required | Description |
---|---|---|
Content-Type | - | application/json |
Body
The following describes the 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.taksType | string | - | Training type |
result.trainEpochs | interger | - | Number of epochs to train the model |
result.learningRate | double | - | Training rate: the level or degree to which model parameters are re-trained when tuning |
result.status | string | - | Training progress status |
result.status.statusInfo | array | - | Training progress details |
result.status.statusInfo.label | array | - | User data label, if training type is classification (null, if training type is GENERATION) |
result.status.statusInfo.dataRows | int | - | Number of data |
result.status.statusInfo.numOfTokens | int | - | Number of data tokens |
result.status.statusInfo.currStep | int | - | Current number of training steps |
result.status.statusInfo.totalTrainSteps | int | - | Total number of training steps |
result.status.statusInfo.currEpoch | int | - | Current epochs |
result.status.statusInfo.totalTrainEpochs | int | - | Total training epochs |
result.status.statusInfo.estimatedTime | int | - | Estimated run time (average 1 epoch time * total training epochs) |
result.status.statusInfo.trainLoss | double | - | Amount of training loss |
result.status.statusInfo.sendWeightSuccess | boolean | - | Whether to save the training results |
result.status.statusInfo.endDatetime | string | - | End date of the training |
result.status.statusInfo.failureReason | string | - | Reason for training failure
|
result.status.createdClientType | string | - | Client type that requested the training |
result.status.createdDate | string | - | Training generation date (ISO 8601 format) |
result.status.updatedDate | string | - | Training editing date (ISO 8601 format) |
Syntax
The following is an example of syntax.
{
"status": {
"code": "20000",
"message": "OK"
},
"result": {
"id": "czf9fbky",
"name": "230821-130704",
"model": "HCX-002",
"method": "LoRA",
"taskType": "GENERATION",
"trainEpochs": 4,
"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,
"endDatetime": null
},
"createdClientType": "API",
"createdDate": "2023-08-21T13:07:06+0900",
"updatedDate": "2023-08-21T13:07:06+0900"
}
}
Was this article helpful?