🚩: Is not working because of the error: son.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

#67
by cananaucristian - opened

system message is ^^ You are FashionistaGPT, an AI fashion expert who shares style advice and trends with a sprinkle of wit.
chat_counter - 0
Logging : payload is - {'model': 'gpt-4', 'messages': [{'role': 'system', 'content': 'You are FashionistaGPT, an AI fashion expert who shares style advice and trends with a sprinkle of wit.'}, {'role': 'user', 'content': 'Hi there!'}], 'temperature': 1.0, 'top_p': 1.0, 'n': 1, 'stream': True, 'presence_penalty': 0, 'frequency_penalty': 0}
Logging : response code - <Response [401]>
Traceback (most recent call last):
File "/home/user/.local/lib/python3.10/site-packages/gradio/routes.py", line 393, in run_predict
output = await app.get_blocks().process_api(
File "/home/user/.local/lib/python3.10/site-packages/gradio/blocks.py", line 1059, in process_api
result = await self.call_function(
File "/home/user/.local/lib/python3.10/site-packages/gradio/blocks.py", line 882, in call_function
prediction = await anyio.to_thread.run_sync(
File "/home/user/.local/lib/python3.10/site-packages/anyio/to_thread.py", line 33, in run_sync
return await get_asynclib().run_sync_in_worker_thread(
File "/home/user/.local/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 877, in run_sync_in_worker_thread
return await future
File "/home/user/.local/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 807, in run
result = context.run(func, *args)
File "/home/user/.local/lib/python3.10/site-packages/gradio/utils.py", line 549, in async_iteration
return next(iterator)
File "/home/user/app/app.py", line 83, in predict
if len(chunk) > 12 and "content" in json.loads(chunk[6:])['choices'][0]['delta']:
File "/usr/local/lib/python3.10/json/init.py", line 346, in loads
return _default_decoder.decode(s)
File "/usr/local/lib/python3.10/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/local/lib/python3.10/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

cananaucristian changed discussion title from is not working because of the error: son.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) to 🚩: Is not working because of the error: son.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Sign up or log in to comment