Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BingCreateImages error #1973

Closed
ufoptg opened this issue May 18, 2024 · 7 comments
Closed

BingCreateImages error #1973

ufoptg opened this issue May 18, 2024 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@ufoptg
Copy link

ufoptg commented May 18, 2024

Bug description
after updating to latest g4f i get this error
An unexpected error occurred: 'BingCreateImages' object has no attribute 'name'

@ufoptg ufoptg added the bug Something isn't working label May 18, 2024
@hlohaus
Copy link
Collaborator

hlohaus commented May 18, 2024

Do you have stacktrace for this error?

@ufoptg
Copy link
Author

ufoptg commented May 19, 2024

Do you have stacktrace for this error?

ill show you

@ufoptg
Copy link
Author

ufoptg commented May 19, 2024

05/19/2024, 17:36:21 | ⛧Nim⛧pyLogs [INFO] : 'BingCreateImages' object has no attribute '__name__'
Traceback (most recent call last):
  File "addons/chatgpt.py", line 135, in handle_bigen
    response = await imgclient.images.generate(prompt=query, model="dall-e-3")
  File "/home/loki/ts/.ult/lib/python3.9/site-packages/g4f/client/async_client.py", line 224, in generate
    response = create_image(
  File "/home/loki/ts/.ult/lib/python3.9/site-packages/g4f/client/async_client.py", line 187, in create_image
    if provider.__name__ == "You":
AttributeError: 'BingCreateImages' object has no attribute '__name__'

File: chatgpt.py, Line 135

@ufoptg
Copy link
Author

ufoptg commented May 19, 2024

This is what i get when trying to use Normal Client

👩‍💻 Ⲉⳳⲁⳑ (in 0.672ms)
from g4f.client import Client

client = Client()
response = client.images.generate(
    model="dall-e-3",
    prompt="a white siamese cat",
)
image_url = response.data[0].url

p(image_url)
 

👨‍💻 Ⲟυⲧⲣυⲧ: 
Traceback (most recent call last):
  File "/home/loki/ts/Nimbus/plugins/devtools.py", line 267, in _
    value = await aexec(cmd, event)
  File "/home/loki/ts/Nimbus/plugins/devtools.py", line 351, in aexec
    return await locals()["__aexec"](event, event.client)
  File "<string>", line 10, in __aexec
  File "/home/loki/ts/.ult/lib/python3.9/site-packages/g4f/client/client.py", line 150, in generate
    response = list(provider.create(prompt))
AttributeError: 'BingCreateImages' object has no attribute 'create'

and this what happens with AsyncClient

👩‍💻 Ⲉⳳⲁⳑ (in 0.396ms)
from g4f.client import AsyncClient

client = AsyncClient()
response = await client.images.generate(
    model="dall-e-3",
    prompt="a white siamese cat",
)
image_url = response.data[0].url

p(image_url)
 

👨‍💻 Ⲟυⲧⲣυⲧ: 
Traceback (most recent call last):
  File "/home/loki/ts/Nimbus/plugins/devtools.py", line 267, in _
    value = await aexec(cmd, event)
  File "/home/loki/ts/Nimbus/plugins/devtools.py", line 351, in aexec
    return await locals()["__aexec"](event, event.client)
  File "<string>", line 10, in __aexec
  File "/home/loki/ts/.ult/lib/python3.9/site-packages/g4f/client/async_client.py", line 224, in generate
    response = create_image(
  File "/home/loki/ts/.ult/lib/python3.9/site-packages/g4f/client/async_client.py", line 187, in create_image
    if provider.__name__ == "You":
AttributeError: 'BingCreateImages' object has no attribute '__name__'

@ufoptg
Copy link
Author

ufoptg commented May 19, 2024

works fine when i downgrade back to v0.3.1.0

@hlohaus
Copy link
Collaborator

hlohaus commented May 19, 2024

Hello, I fixed this problem in the latest version of the code.

AttributeError: 'BingCreateImages' object has no attribute 'name'

@ufoptg
Copy link
Author

ufoptg commented May 20, 2024

beautiful! :) Great job

@ufoptg ufoptg closed this as completed May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants