0

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
VLAZ
  • 26,331
  • 9
  • 49
  • 67
Saddam
  • 23
  • 1
  • 5
  • I experience the same behavior for all tile types (`"search"`, `"answers"`, `"classifications"`, and `"fine-tune"`). – irudnyts May 23 '22 at 09:16
  • Found the answer: check out this [thread](https://community.openai.com/t/retrieve-file-content-api-is-not-allowing-to-retrive-content/11952) in their official forum. – irudnyts May 23 '22 at 09:20

1 Answers1

0

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

AADARSH K
  • 81
  • 1
  • 6