diff --git a/cogs/other.py b/cogs/other.py index d00412f..34fedd7 100644 --- a/cogs/other.py +++ b/cogs/other.py @@ -94,7 +94,8 @@ async def ollama_stream_reader(response: httpx.Response) -> typing.AsyncGenerato # Each chunk is a JSON string try: yield json.loads(chunk.strip().decode("utf-8", "replace")) - except json.JSONDecodeError: + except json.JSONDecodeError as e: + print("Failed to decode chunk %r: %r" % (chunk, e), file=sys.stderr) pass