gpt4 book ai didi

python - OpenAI 检索文件内容

转载 作者:行者123 更新时间:2023-12-02 05:47:54 26 4
gpt4 key购买 nike

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

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

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

最佳答案

来自 OpenAI 社区的回答

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. ↗️

关于python - OpenAI 检索文件内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71333114/

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