OpenAI 检索文件内容

发布于 2025-01-11 04:53:32 字数 762 浏览 0 评论 0原文

无法检索已上传的文件内容。

请建议出了什么问题?我尝试过每种类型的文件:搜索、分类、答案和微调。文件上传成功,但在检索内容时显示错误。

import openai

openai.api_key = "sk-bbjsjdjsdksbndsndksbdksbknsndksd" # this is wrong key

# Replace file_id with the file's id whose file content is required
content = openai.File.download("file-5Xs86wEDO5gx8fOitMYArV8r")

print(content)

错误:

Traceback (most recent call last):
  File "main.py", line 6, in <module>
    content = openai.File.download("file-5Xs86wEDO5gx8fOitMYArV8r")
  File "/usr/local/lib/python3.8/dist-packages/openai/api_resources/file.py", line 61, in download
    raise requestor.handle_error_response(
openai.error.InvalidRequestError: Not allowed to download files of purpose: classifications

Unable to retrieve the content of file uploaded already.

Kindly suggest what is going wrong? I have tried for each type of file: search, classification, answers, and fine-tune. Files upload successfully but while retrieving content it shows an error.

import openai

openai.api_key = "sk-bbjsjdjsdksbndsndksbdksbknsndksd" # this is wrong key

# Replace file_id with the file's id whose file content is required
content = openai.File.download("file-5Xs86wEDO5gx8fOitMYArV8r")

print(content)

Error:

Traceback (most recent call last):
  File "main.py", line 6, in <module>
    content = openai.File.download("file-5Xs86wEDO5gx8fOitMYArV8r")
  File "/usr/local/lib/python3.8/dist-packages/openai/api_resources/file.py", line 61, in download
    raise requestor.handle_error_response(
openai.error.InvalidRequestError: Not allowed to download files of purpose: classifications

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

终难愈 2025-01-18 04:53:32

OpenAI社区的回答

目前,我们只允许下载微调运行的结果,而不允许下载微调运行的输入文件。我们也不允许下载搜索相关文件。 ↗️

Answer from OpenAI community

Currently, we only allow downloads on the results of fine-tuning runs and not the input files to the fine tuning run. We also don’t allow downloads for search related files. ↗️

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文