Query fine-tuning logs

更新时间:
复制 MD 格式

Retrieves training logs for a specified fine-tuning job.

Request

In Windows CMD, replace ${DASHSCOPE_API_KEY} with %DASHSCOPE_API_KEY%. In PowerShell, replace it with $env:DASHSCOPE_API_KEY.
curl --location --request GET "https://dashscope.aliyuncs.com/api/v1/fine-tunes/<your-fine-tuning-job-id>/logs?offset=10&line=10" \
      --header "Authorization: Bearer ${DASHSCOPE_API_KEY}" \
      --header 'Content-Type: application/json' 

Request parameters

Parameter

Type

Location

Required

Description

job_id

String

Path

Yes

The ID of the fine-tuning job to query. You can obtain this ID from the Create a fine-tuning job or List fine-tuning jobs operation.

offset

Number

Query

No

Skips the first offset lines of output and starts reading from line offset+1. The value cannot exceed the total number of existing output lines. If the value is exceeded, no output is returned. The default value is 0.

line

Number

Query

No

Starts reading from line offset+1 (inclusive) and reads line lines of output. If the output of this request has fewer than line lines, the actual output is returned. The default value is 100, and the upper limit is 1000.

Sample response

{
          "request_id": "ce49b45d-fe46-474e-9e1b-3e7427ffdf5a",
          "output": {
              "total": 20,
              "logs": [
                  "{'train_runtime': 216.3999, 'train_samples_per_second': 2.066, 'train_steps_per_second': 0.014, 'train_loss': 0.9122632344563802, 'epoch': 0.8571428571428571}",
                  " Actual number of consumed tokens is 279808!",
                  " Uploaded checkpoint!",
                  " Fine-tune succeeded!",
                  " use checkpoint-3 as final checkpoint",
                  "2024-10-29 17:03:47,719 - INFO - transfer for inference succeeded, start to deliver it for inference",
                  "2024-10-29 17:09:43,322 - INFO - start to save checkpoint",
                  "2024-10-29 17:11:24,689 - INFO - finetune-job succeeded",
                  "2024-10-29 17:11:25,130 - INFO - training usage 279808",
                  "2024-10-29 17:11:25,175 - INFO - ##FT_COMPLETE##"
              ]
          }
      }

Response parameters

Parameter

Type

Description

request_id

String

The unique identifier for this request.

output

Object

Contains the detailed query results.

output.total

Integer

The total number of log lines.

output.logs

Array

The log lines returned by the request.

Error codes

Returned when a request fails.

Parameter

Type

Description

Example

code

String

The error code.

NotFound

request_id

String

The unique identifier for this request.

6332fb02-3111-43f0-bf79-f9e8c5ffa7f9

message

String

The error message.

Not Found!

Sample error response

{
        "code": "NotFound",
        "request_id": "BE213CDD-8A5C-59EE-9A67-055EAB0CB59B",
        "message": "Not Found!"
      }

Error code list

HTTP status code

Error code

Error message

Description

Solution

400

InvalidParameter

Missing training files

A parameter is invalid, missing, or in an unsupported format.

Check the error message and correct the invalid parameter.

400

UnsupportedOperation

The fine-tuning job cannot be deleted because it has succeeded, failed, or been canceled.

The operation cannot be performed because the resource is in a specific state.

Wait for the resource to enter a valid state before retrying the operation.

404

NotFound

Not found!

The requested resource does not exist.

Verify that the resource ID is correct.

409

Conflict

Deployment instance xxxxx already exists. Please specify a suffix.

A deployment instance with the specified name already exists. You must provide a unique suffix to resolve the conflict.

Specify a unique suffix for the deployment.

429

Throttling

  • Too many fine-tuning jobs are running. Please retry later.

  • A maximum of 20 running or succeeded fine-tuning jobs are allowed per user.

The request was throttled because a platform limit was reached.

  • Delete any unused models.

  • To increase the concurrency limit for fine-tuning jobs or the number of retained models, contact your business manager.

500

InternalError

Internal server error!

An internal error occurred.

Record the request_id and submit a ticket to Alibaba Cloud engineers for assistance.