gpt4 book ai didi

python - OpenAI API 错误 : "InvalidRequestError: Invalid URL (POST/v1/classifications)"

转载 作者:行者123 更新时间:2023-12-02 05:46:23 25 4
gpt4 key购买 nike

我正在尝试使用 OpenAI API,但遇到了分类端点问题。

首先我上传了包含用于分类训练的文本、标签和元数据的jsonl文件,这是成功的

res = openai.File.create(file=open("Classification.jsonl"), purpose = "classifications")

{
"bytes": 1054,
"created_at": 1672647540,
"filename": "file",
"id": "file-9GnLgjFKhSOXOYlSZtPwbJBf",
"object": "file",
"purpose": "classifications",
"status": "uploaded",
"status_details": null
}

接下来,我尝试按照 https://beta.openai.com/docs/guides/classifications 中提供的指南查询它

openai.Classification.create(
file="file-9GnLgjFKhSOXOYlSZtPwbJBf",
query="movie is very good",
search_model="ada",
model="curie",
max_examples=3
)

收到错误:`


InvalidRequestError: Invalid URL (POST /v1/classifications)

`

还尝试使用 curl,但效果不佳。谁能告诉我解决方案是什么?

谢谢

我尝试了什么:根据文档逐行:https://beta.openai.com/docs/guides/classifications

我期望发生的事情:期待一个有效的回应

实际结果:发布错误,无效 url

最佳答案

分类端点自 2022 年 12 月 3 日起弃用

Deprecated

如官方所述OpenAI article :

​Since releasing the Classifications endpoint in beta last year, we’vedeveloped new methods that achieve better results for this task. As aresult, we’ll be removing the Classifications endpoints from ourdocumentation and removing access to this endpoint on December 3, 2022for all organizations. New accounts created after June 3rd will nothave access to this endpoint.

您有以下选择:

关于python - OpenAI API 错误 : "InvalidRequestError: Invalid URL (POST/v1/classifications)",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/74981957/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com