gpt4free icon indicating copy to clipboard operation
gpt4free copied to clipboard

[HuggingChat] ERROR:root:Expecting ',' delimiter: line 1 column 28 (char 27)

Open iG8R opened this issue 1 year ago • 2 comments

When using the HuggingChat provider with the default model, the following error occurs:

Using HuggingChat provider
ERROR:root:Expecting ',' delimiter: line 1 column 28 (char 27)
Traceback (most recent call last):
  File "c:\gpt4free\venv\Lib\site-packages\g4f\gui\server\backend.py", line 191, in _create_response_stream
    for chunk in ChatCompletion.create(**kwargs):
  File "c:\gpt4free\venv\Lib\site-packages\g4f\Provider\base_provider.py", line 205, in create_completion
    yield loop.run_until_complete(await_callback(gen.__anext__))
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python312\Lib\asyncio\base_events.py", line 664, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "c:\gpt4free\venv\Lib\site-packages\g4f\Provider\base_provider.py", line 201, in await_callback
    return await callback()
           ^^^^^^^^^^^^^^^^
  File "c:\gpt4free\venv\Lib\site-packages\g4f\Provider\HuggingChat.py", line 66, in create_async_generator
    line = json.loads(line[:-1])
           ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python312\Lib\json\__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python312\Lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python312\Lib\json\decoder.py", line 353, in raw_decode
    obj, end = self.scan_once(s, idx)
               ^^^^^^^^^^^^^^^^^^^^^^
json.decoder.JSONDecodeError: Expecting ',' delimiter: line 1 column 28 (char 27)
127.0.0.1 - - [17/Feb/2024 00:25:28] "POST /backend-api/v2/conversation HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [17/Feb/2024 00:25:28] "POST /backend-api/v2/conversation HTTP/1.1" 200 -

iG8R avatar Feb 16 '24 22:02 iG8R

Bumping this issue because it has been open for 7 days with no activity. Closing automatically in 7 days unless it becomes active again.

github-actions[bot] avatar Feb 24 '24 00:02 github-actions[bot]

HuggingChat is still not working. I don't found a solution jet

hlohaus avatar Feb 25 '24 10:02 hlohaus

Bumping this issue because it has been open for 7 days with no activity. Closing automatically in 7 days unless it becomes active again.

github-actions[bot] avatar Mar 05 '24 00:03 github-actions[bot]

Closing due to inactivity.

github-actions[bot] avatar Mar 14 '24 00:03 github-actions[bot]