Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Attribute Error: openai has no attribute Image

So I was getting my hands-on on the new DALL.E api for Python which has been made public. I was getting the Attribution Error as it was not detecting the Image model in Open ai after running the following code:

response = openai.Image.create(
  prompt="a white siamese cat",
  n=1,
  size="1024x1024"
)
image_url = response['data'][0]['url']

Why am I getting this error?

like image 725
Usman Afridi Avatar asked Nov 19 '25 15:11

Usman Afridi


1 Answers

I just found the solution. You have to upgrade your openai library with code:

pip install --upgrade openai

Restart the kernel, and enjoy :)

like image 54
Usman Afridi Avatar answered Nov 21 '25 04:11

Usman Afridi