随着OpenAI最终公开开放了与GPT-3相关的API,我开始尝试使用它来探索和发现其潜力。
我正在尝试使用Answer API,这是文档中提供的一个简单示例:https://beta.openai.com/docs/guides/answers
我按照指示上传了.jsonl
文件,并通过openai.File.list()
API确认文件已成功上传。
然而,当我尝试使用它时,不幸的是,我总是得到相同的错误:
>>> openai.File.create(purpose='answers', file=open('example.jsonl') )<File file id=file-xxx at 0x7fbc9eca5e00> JSON: { "bytes": 140, "created_at": 1637597242, "filename": "example.jsonl", "id": "file-xxx", "object": "file", "purpose": "answers", "status": "uploaded", "status_details": null}#在API中使用文件:openai.Answer.create( search_model="ada", model="curie", question="which puppy is happy?", file="file-xxx", examples_context="In 2017, U.S. life expectancy was 78.6 years.", examples=[["What is human life expectancy in the United States?", "78 years."]], max_rerank=10, max_tokens=5, stop=["\n", "<|endoftext|>"])<some exception, then>openai.error.InvalidRequestError: File is still processing. Check back later.
我已经等了几个小时,我认为这些内容不应该需要这么长时间的等待…你知道这是正常行为吗,或者我是否遗漏了什么?
谢谢
回答:
在几个小时之后(第二天),文件的元数据状态从uploaded
变为processed
,此时文件可以按照文档中所述在Answer API中使用了。
我认为这需要在原始的OpenAI API参考文档中得到更好的说明。