ytyz1307zzh / Auto-Instruct

Code repo for EMNLP 2023 paper "Auto-Instruct: Automatic Instruction Generation and Ranking for Black-Box Language Models"
18 stars 2 forks source link

gpt-utils.py #6

Closed zxqSled closed 10 months ago

zxqSled commented 10 months ago

Hello,how can i use my own openai-key in gpt-utils.py, i always get HTTPError:500 in result. When I replace the openai.api in the "Authorization: Bearer" line of the script with my own key, the message in response is still "You didn't provide an API key. You need to provide your API key in an Authorization header". how can i deal with it? Thank you very much!!!

ytyz1307zzh commented 10 months ago

Hi, could you specify which script you are trying to run? gpt_utils.py is not meant to be directly run. Instead, it should be imported to other scripts. Did you provide the API key in the command line arguments?

zxqSled commented 10 months ago

Hello,i try to run gpt3_instructiongeneration.py,but it reported an error and traced back to gpt utils.py. I have provided api kei with -api_key = "****",is it right?I just modified the content in the request header "https://api.openai.com" ,or the error message "[Errno 101] Network is unreachable" will in return, but after I make the changes, the error message "HTTPError: 500 Server Error" will appear. When I click on the link, it will prompt me that I did not provide an apikey...Could you give me some help or advice,thanks very much!!

ytyz1307zzh commented 10 months ago

Hi, suppose your API key is ABCDE, you just need to append "-api_key ABCDE" to your Python command.

zxqSled commented 10 months ago

Hi,i know it's a network issue with the server , thanks for your reply!!!!!

ytyz1307zzh commented 10 months ago

No problem!