AttributeError: module ‘openai’ has no attribute ‘FineTuneingJob’

题意:尝试访问的 FineTuneingJob 属性在 openai 模块中不存在

问题背景:

I am attempting to start a fine-tuning job using GPT 3.5-turbo via a Python call, using the format listed in the fine-tuning reference, essentially:

我正在尝试通过Python调用使用GPT 3.5-turbo启动一个微调任务,使用微调参考中列出的格式,基本上是这样的:

import os
import openai
openai.api_key = os.getenv("OPENAI_API_KEY")
openai.FineTuningJob.create(training_file="file-abc123", model="gpt-3.5-turbo")

However, I am running into the AttributeError “module ‘openai’ has no attribute ‘FineTuneingJob’”.

然而,我遇到了 AttributeError:“module ‘openai’ has no attribute ‘FineTuneingJob’”。

I am running openai v0.27.8. In addition, I uploaded my training data successfully using

我正在运行 openai 的 v0.27.8 版本。此外,我已经成功上传了我的训练数据,使用的是

openai.File.create(
    file=open("train_chat_gpt.jsonl", "rb"),
    purpose='fine-tune'
)

Any suggestions how to fix this? Thanks.

关于如何解决这个问题,有什么建议吗?谢谢。

问题解决:

Finally I found the solution.

最后我找到了解决方案。

I had an old version (0.27.8) of the openai module; however, the FineTuningJob function is available starting from version 0.27.9 of the module.

我使用的 openai 模块是旧版本(0.27.8),但是 FineTuningJob 函数从该模块的 0.27.9 版本开始才可用。

So, you need to update the openai module with the following command:

所以,你需要使用以下命令来更新 openai 模块:

pip install --upgrade openai

  • 7
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

营赢盈英

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值