tatsu-lab / stanford_alpaca

Code and documentation to train Stanford's Alpaca models, and generate the data.
https://crfm.stanford.edu/2023/03/13/alpaca.html
Apache License 2.0
29.32k stars 4.03k forks source link

about generate instructions #211

Open YJiangcm opened 1 year ago

YJiangcm commented 1 year ago

Thanks for your valuable work! I have a question: during generating new instructions by using text-davinci-003, if I want to use my openai API key, should I change the following code in utils.py to something like openai.api_key = ?

openai_org = os.getenv("OPENAI_ORG")
if openai_org is not None:
    openai.organization = openai_org
    logging.warning(f"Switching to organization: {openai_org} for OAI API key.")
Ahtesham00 commented 1 year ago

set the environment variable. probably thats the variable OPENAI_ORG In linux you can do following

export OPENAI_ORG="your-api-key"