在Windows中使用OpenAI API键的问题
我必须在自定义数据集中微调OpenAI模型。我以JSONL格式创建了数据集。我在Windows命令行上使用以下命令:
设置OpenAI_API_KEY =< api键>
openai tools fine_tunes.prepare_data -f“ train_data.jsonl”
给我一些更新JSONL文件的建议。之后,我运行以下命令来微调“居里”模型。
OpenAI API FINE_TUNES.CREATE'openai.api_key =< api键>' -t“ train_data.jsonl” -m“ curie”
,但我会得到以下问题:
←[91merror:←[0m不正确的API密钥提供:“ SK -IQJX ********** ******************************************。您可以在https://beta.openai.com上找到API键。 (HTTP状态代码:401)
任何人都可以帮助我解决这个问题。
I have to fine-tune the OpenAI model on my custom dataset. I have created the dataset in jsonl format. I use the following commands on windows command line:
set OPENAI_API_KEY=<API key>
openai tools fine_tunes.prepare_data -f "train_data.jsonl"
The above commands run successfully and give me some suggestions for updating jsonl file. After this, I run the following command to fine-tune the 'curie' model.
openai api fine_tunes.create 'openai.api_key = <API key>' -t "train_data.jsonl" -m "curie"
But I am getting following issue:
←[91mError:←[0m Incorrect API key provided: "sk-iQJX*****************************************mux". You can find your API key at https://beta.openai.com. (HTTP status code: 401)
Can anybody help me out with this issue.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
在Windows命令提示符中使用以下内容
Use the following in the windows command prompt
这是较早版本的OpenAI CLI的常见问题。如果还没有,请确保您通过执行
一个可能的解决方法来升级到最近的版本,就是使用Python脚本来完成您在CLI中通常会做的事情。
This is a common issue with an earlier version of the openai's CLI. If you haven't already, make sure you upgrade to the most recent version by doing
One possible workaround is to just use a python script to do what you would normally do in the CLI.
在命令行中分配API键时,请勿使用以下双引号,例如:
api_key = ab-123123123123123123231
这将解决问题
When assigning the API key in command line, dont use double quotes like:
API_KEY=ab-123123123123123231
This will solve the issue
嗨,此代码将解决问题。在这种情况下,请确保在= OpenAi_Api_Key之前正确设置环境变量:
最好,Alexis
Hi this code will solve the problem. Make sure you set your environment variable properly before =OPENAI_API_KEY in this case:
Best, Alexis