You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

调用OpenAI API获取微调模型时fine_tuned_model返回null求助

微调任务返回fine_tuned_model为null的原因及解决办法

你的微调任务当前状态是running,模型还在训练过程中,OpenAI尚未生成最终的微调模型ID,因此fine_tuned_model字段会显示为null。

解决步骤

  • 等待训练完成:定期调用fineTuning.jobs.retrieve接口查询任务状态,当状态变为succeeded时,fine_tuned_model字段会自动填充生成的微调模型名称
  • 排查异常情况:如果任务状态变为failed,查看返回结果中的error字段获取具体错误信息,针对性解决问题

创建微调任务代码

const model = await openai.fineTuning.jobs.create({
  training_file: process.env.FILE_ID,
  model: 'babbage-002',
})

获取微调任务信息代码

const response = await openai.fineTuning.jobs.retrieve(
    process.env.FINE_TUNE_ID,
)

API返回结果

{
  "object": "fine_tuning.job",
  "id": "ftjob-NSFvxzJtTSfR5jcqQTfeDTCo",
  "model": "babbage-002",
  "created_at": 1722546992,
  "fine_tuned_model": null,
  "organization_id": "org-GLjhkXwkbQrLOvHk0762UcmL",
  "result_files": [],
  "status": "running",
  "validation_file": null,
  "training_file": "file-Lh1C4Vv1HDIv7LxXUGh9mIL9",
  "hyperparameters": { "n_epochs": 9, "batch_size": 1, "learning_rate_multiplier": 16 },
  "trained_tokens": null,
  "error": {},
  "user_provided_suffix": null,
  "seed": 1564492262,
  "estimated_finish": null,
  "integrations": []
}

内容的提问来源于stack exchange,提问作者Denis Prosvietov

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.20 02:23:11