microsoft / TOXIGEN

This repo contains the code for generating the ToxiGen dataset, published at ACL 2022.
Other
269 stars 32 forks source link

KeyError: 'choices' #15

Closed PhanVanVien closed 1 year ago

PhanVanVien commented 1 year ago

First of all let me thank your research team. And sorry if I don't speak English very well. I'm very interested in your research but I have one error when running on both jupyter and notebook. image Looking forward to your reply. Thank you.

Thartvigsen commented 1 year ago

Hello, could you print(output) and show what it returns?

PhanVanVien commented 1 year ago

Thanks for your reply and here is the result image

Thartvigsen commented 1 year ago

Could you show the output that's returned when you print(output)? And I assume you've got your API key from OpenAI set up?

PhanVanVien commented 1 year ago

I'm sorry if my answer is not right for your question

  1. I can't print by this way whether the print method you said I should look for ? I just go to the file /usr/local/lib/python3.8/dist-packages/toxigen/language_models.py and add print(output) but no nothing happens. image

  2. I checked the requests but it didn't come up with a viable result image

  3. With Invalid Key (I removed a stream of key) image Result is Error

With Valid Key (I hide my key for secret) image Does this mean my key is working properly ?

  1. And this code only works with roberta. I read about this in #8 image Thank you.
PhanVanVien commented 1 year ago

image When i call function call .

PhanVanVien commented 1 year ago
  1. I try with url = "https://api.openai.com/v1/engines/text-ada-001" and response = requests.get(url, headers=headers) (get method) image and result: image

  2. I try with url = "https://api.openai.com/v1/engines/text-ada-001/completions" or response = requests.post(url, headers=headers) (post method and without json=data)/response = requests.get(url, headers=headers, json=data) image

Thank you.

PhanVanVien commented 1 year ago

I look forward to your response.

Thartvigsen commented 1 year ago

It looks like one of the errors shows that you have exceeded your quota for GPT-3 api calls?

image

PhanVanVien commented 1 year ago

Could you check again with your secret API key one time? And Do you pay to use? Because I remember that it's free on this time, especially this my new account and I don't use anything before. I look forward to your response.

Thartvigsen commented 1 year ago

Unfortunately, I do not pay to use it and I no longer have access. Have you tried following along with their Python API documentation to make sure it's actually working on your end? Sadly I don't have any extra information about GPT-3 internals, so when things shift in their API I don't have any tools to debug that.

PhanVanVien commented 1 year ago

yes i get it. Thank you for your interesting work and quick responses from you. Sad to not be able to access it anymore. I'll find another way.

Thartvigsen commented 1 year ago

Sorry that I can't help more.. if you discover that the problem is with the ToxiGen code, I am more than happy to help out!