Generating training
    • PDF

    Generating training

    • PDF

    Article Summary

    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:

    MethodURI
    POST/tuning/v2/tasks

    Header

    The following describes the header.

    FieldRequiredDescription
    X-NCP-APIGW-TIMESTAMPYTime 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-KEYYAccess key ID issued from NAVER Cloud Platform portal
    x-ncp-iam-access-key:{Main Account Access Key}
    X-NCP-APIGW-SIGNATURE-V2YSignature encrypted with the access key ID value and secret key
    x-ncp-apigw-signature-v2:{API Gateway Signature}
    X-NCP-CLOVASTUDIO-REQUEST-IDNRequest ID for each request
    Content-TypeYmultipart/form-data

    Body

    The following describes the body.

    FieldTypeRequiredDescription
    namestringNTraining name (default: training creation date)
    modelstringYTuning model name
    tuningTypestringNTuning method
  • PEFT (default value)
  • taskTypestringNTraining type
  • GENERATION: generation (default value)
  • CLASSIFICATION: classification
  • trainEpochsstringNNumber of epochs to train the model
  • 1-20 (default value: 4)
  • learningRatestringNTraining rate: the level or degree to which model parameters are re-trained when tuning
  • 1-1.0E-6 (default value: 1.0E-4)
  • trainingDatasetstringYDataset 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.

    HeaderRequiredDescription
    Content-Type-application/json

    Body

    The following describes the body.

    FieldTypeRequiredDescription
    resultobject-Response result
    result.idstring-Training ID
    result.namestring-Training name
    result.modelstring-Tuning model name
    result.methodstring-Tuning method
  • LoRA
  • result.taksTypestring-Training type
  • GENERATION: generation
  • CLASSIFICATION: classification
  • result.trainEpochsinterger-Number of epochs to train the model
    result.learningRatedouble-Training rate: the level or degree to which model parameters are re-trained when tuning
    result.statusstring-Training progress status
  • WAIT
  • RUNNING
  • FAILED
  • SUCCEEDED
  • result.status.statusInfoarray-Training progress details
    result.status.statusInfo.labelarray-User data label, if training type is classification (null, if training type is GENERATION)
    result.status.statusInfo.dataRowsint-Number of data
    result.status.statusInfo.numOfTokensint-Number of data tokens
    result.status.statusInfo.currStepint-Current number of training steps
    result.status.statusInfo.totalTrainStepsint-Total number of training steps
    result.status.statusInfo.currEpochint-Current epochs
    result.status.statusInfo.totalTrainEpochsint-Total training epochs
    result.status.statusInfo.estimatedTimeint-Estimated run time (average 1 epoch time * total training epochs)
    result.status.statusInfo.trainLossdouble-Amount of training loss
    result.status.statusInfo.sendWeightSuccessboolean-Whether to save the training results
    result.status.statusInfo.endDatetimestring-End date of the training
    result.status.statusInfo.failureReasonstring-Reason for training failure
    • file.read: file recognition failed
    • file.privacy: private information exists in the file
    • file.harmful: harmful information exists in the file
    • resource.timeout: response timeout due to GPU acquisition failure. Retry required
    • result.store: failed to store training results
    • db.timeout: response timeout due to DB connection failure. Retry required
    result.status.createdClientTypestring-Client type that requested the training
  • API: API client
  • WEB: web client
  • result.status.createdDatestring-Training generation date (ISO 8601 format)
    result.status.updatedDatestring-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?

    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.