Categories:

String & binary functions (AI Functions)

FINETUNE (‘DESCRIBE’) (SNOWFLAKE.CORTEX)

Describes the properties of a fine-tuning job. If the job completes successfully, additional details about the job are returned, including the final model name. Use this name when using the COMPLETE (SNOWFLAKE.CORTEX) function to make an inference on your fine-tuned model.

语法

SNOWFLAKE.CORTEX.FINETUNE(
  'DESCRIBE',
  '<finetune_job_id>'
)

参数

'DESCRIBE'

指定要获取所提供微调作业的属性。

finetune_job_id

创建作业时生成的微调作业的 ID。

输出

ColumnTypeDescription
SNOWFLAKE.CORTEX.FINETUNEOBJECT

An object containing the job status, progress and the tuning job ID. If the job status is SUCCESS, additional job information is returned.

id

用于调整作业的唯一 ID。

status

状态为以下状态之一:

  • PENDING
  • IN_PROGRESS
  • SUCCESS
  • ERROR
  • CANCELLED
progress

一个介于 0 和 1 之间的数字,表示作业完成的百分比,1.0 表示 100%。

error

If the job has a status of ERROR, an object that contains the error message.

base_model

用于微调作业的基本模型的名称。

created_on

作业创建时的时间戳。

finished_on

If the job has a status of SUCCESS, the timestamp of when the job finished.

model

If the job has a status of SUCCESS, the fine-tuned model name. Use this name when calling the COMPLETE function for inference.

training_data

用于检索训练数据的查询。

trained_tokens

If the job has a status of SUCCESS, the number of tokens used for training. This is calculated by the following formula:

trained tokens = number of input tokens  * number of epochs trained
training_result

If the job has a status of SUCCESS, the training result of the fine-tuning job.

validation_data

用于检索验证数据的查询。

options

An object containing zero or more of options that affect the training hyperparameters.

访问控制要求

For access requirements, see Access control requirements.

示例

SELECT SNOWFLAKE.CORTEX.FINETUNE(
  'DESCRIBE',
  'ft_6556e15c-8f12-4d94-8cb0-87e6f2fd2299'
);

成功作业的输出示例:

{
  "base_model":"mistral-7b",
  "created_on":1717004388348,
  "finished_on":1717004691577,
  "id":"ft_6556e15c-8f12-4d94-8cb0-87e6f2fd2299",
  "model":"mydb.myschema.my_tuned_model",
  "progress":1.0,
  "status":"SUCCESS",
  "training_data":"SELECT prompt, completion FROM train",
  "trained_tokens":2670734,
  "training_result":{"validation_loss":1.0138969421386719,"training_loss":0.6477728401547047},
  "validation_data":"SELECT prompt, completion FROM validation",
  "options":{"max_epochs":3}
}