I am trying to fine tune a model. I am in the following line:
openai api fine_tunes.create -t <TRAIN_FILE_ID_OR_PATH> -m <BASE_MODEL>
When I try to run it, I get the following message:
No API key provided. You can set your API key in code using ‘openai.api_key = ’, or you can set the environment variable OPENAI_API_KEY=). If your API key is stored in a file, you can point the openai module at it with ‘openai.api_key_path = ’. You can generate API keys in the OpenAI web interface.
I am using Replit, which stores the API key in “Secrets”.
I did this. I mean I keep the <API_KEY> in the variable (openai.api_key)… but still it is showing this error.
Error: No API key provided. You can set your API key in code using ‘openai.api_key = ’, or you can set the environment variable OPENAI_API_KEY=). If your API key is stored in a file, you can point the openai module at it with ‘openai.api_key_path = ’. You can generate API keys in the OpenAI web interface. See https://onboard.openai.com for details, or email support@openai.com if you have any questions.
!openai api fine_tunes.create -t /content/drive/My\ Drive/trainingPromptsAndCompletions1.jsonl -m davinci
I have tried both ways, still getting same error:
Error: No API key provided. You can set your API key in code using ‘openai.api_key = ’, or you can set the environment variable OPENAI_API_KEY=). If your API key is stored in a file, you can point the openai module at it with ‘openai.api_key_path = ’. You can generate API keys in the OpenAI web interface. See https://onboard.openai.com for details, or email support@openai.com if you have any questions.
I have never had a single problem using the environmental variable OPENAI_API_KEY, but I don’t use the OpenAI CLI and deleted it off my workstation within minutes after installing it.
positional arguments:
{api,tools,wandb}
api Direct API calls
tools Client side tools for convenience
wandb Logging with Weights & Biases
options:
-h, --help show this help message and exit
-v, --verbose Set verbosity.
-b API_BASE, --api-base API_BASE
What API base url to use.
-k API_KEY, --api-key API_KEY
What API key to use.
-o ORGANIZATION, --organization ORGANIZATION
Which organization to run as (will use your default organization if not specified)
ex: “openai -k my_api_key api fine_tunes.create -t /home/dataset_prepared.jsonl -m gpt-3.5-turbo”