Closed DarkReaperBoy closed 1 week ago
I have successfully updated the Blackbox provider and its model list.
@hlohaus i mean...
gui:
An error occured: Blackbox: UnboundLocalError: cannot access local variable 'logs' where it is not associated with a value
cli:
ERROR:g4f.gui.server.api:cannot access local variable 'logs' where it is not associated with a value
Traceback (most recent call last):
File "/home/nako/.conda/lib/python3.12/site-packages/g4f/gui/server/api.py", line 179, in _create_response_stream
if logs:
^^^^
UnboundLocalError: cannot access local variable 'logs' where it is not associated with a value
127.0.0.1 - - [19/Nov/2024 20:19:23] "POST /backend-api/v2/conversation HTTP/1.1" 200 -
ERROR:g4f.gui.server.api:cannot access local variable 'logs' where it is not associated with a value
Traceback (most recent call last):
File "/home/nako/.conda/lib/python3.12/site-packages/g4f/gui/server/api.py", line 179, in _create_response_stream
if logs:
^^^^
UnboundLocalError: cannot access local variable 'logs' where it is not associated with a value
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x7fa745b43650>
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x7fa7452abb90>
127.0.0.1 - - [19/Nov/2024 20:19:31] "POST /backend-api/v2/conversation HTTP/1.1" 200 -
ERROR:g4f.gui.server.api:cannot access local variable 'logs' where it is not associated with a value
Traceback (most recent call last):
File "/home/nako/.conda/lib/python3.12/site-packages/g4f/gui/server/api.py", line 179, in _create_response_stream
if logs:
^^^^
UnboundLocalError: cannot access local variable 'logs' where it is not associated with a value
127.0.0.1 - - [19/Nov/2024 20:19:48] "POST /backend-api/v2/conversation HTTP/1.1" 200 -
ERROR:g4f.gui.server.api:cannot access local variable 'logs' where it is not associated with a value
Traceback (most recent call last):
File "/home/nako/.conda/lib/python3.12/site-packages/g4f/gui/server/api.py", line 179, in _create_response_stream
if logs:
^^^^
UnboundLocalError: cannot access local variable 'logs' where it is not associated with a value
Hey, I just fixed the "cannot access local variable" issue in the latest update.
@hlohaus updated again, this time however... it doesn't know to space? also, thanks for your time :pray:
also, during testing noticed that it generates the image link, but doesn't display:
Yeah, it's not working for me either.
@hlohaus hai, so sonnet works fine (first message though, will use it for my programming classes), tysvm :heart: just tested blackbox images for sake of it and wanted to report :pray:
Hey @DarkReaperBoy, can you send me the stack trace from your terminal for that exception? I just tested it again and it's working fine on my end.
Hey @DarkReaperBoy, can you send me the stack trace from your terminal for that exception? I just tested it again and it's working fine on my end.
@hlohaus hai, sure, take a look:
ERROR:g4f.gui.server.api:Invalid image format (from magic code).
Traceback (most recent call last):
File "/home/nako/.conda/lib/python3.12/site-packages/g4f/gui/server/api.py", line 176, in _create_response_stream
images = asyncio.run(self._copy_images(chunk.get_list(), chunk.options.get("cookies")))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/nako/.conda/lib/python3.12/asyncio/runners.py", line 194, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "/home/nako/.conda/lib/python3.12/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/nako/.conda/lib/python3.12/asyncio/base_events.py", line 687, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/home/nako/.conda/lib/python3.12/site-packages/g4f/gui/server/api.py", line 211, in _copy_images
return await asyncio.gather(*[copy_image(image) for image in images])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/nako/.conda/lib/python3.12/site-packages/g4f/gui/server/api.py", line 205, in copy_image
extension = is_accepted_format(f.read(12)).split("/")[-1]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/nako/.conda/lib/python3.12/site-packages/g4f/image.py", line 124, in is_accepted_format
raise ValueError("Invalid image format (from magic code).")
ValueError: Invalid image format (from magic code).
@DarkReaperBoy
The Blackbox is returning non-image files in your case, as indicated by the error message. However, the image generation feature is functioning properly for me.
makes sense since i'm in tourist in a sanctioned country. will look for bugs in g4f once outta the country.
@hlohaus literally same issue again in version 0.3.6.3 sad to see as blackbox is the only sonnet provider that isn't annoyingly ratelimited (note: speaking of which, it was set on auto and picked blackbox, not me.)
i think this image explains enough.
worth mentioning but not going to open separate issue over it: few models that are present in gui ain't in api version of g4f. like qwen coder in huggingface chat.