From ff192c5b881c5d8531976a34a55e58fe9dcaf601 Mon Sep 17 00:00:00 2001 From: nex Date: Fri, 10 Nov 2023 23:25:47 +0000 Subject: [PATCH] cmon --- cogs/other.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cogs/other.py b/cogs/other.py index 2c6fb57..3074db1 100644 --- a/cogs/other.py +++ b/cogs/other.py @@ -97,7 +97,12 @@ async def ollama_stream_reader(response: httpx.Response) -> typing.AsyncGenerato while not _buffer.endswith(b"}\n"): async for char in stream: _buffer += char - print("Read {:,} bytes in chunk for a total of {:,} bytes in buffer.".format(len(char), len(_buffer)) + print( + "Read {:,} bytes in chunk for a total of {:,} bytes in buffer.".format( + len(char), + len(_buffer) + ) + ) _buffer = _buffer.rstrip() print("[ollama stream reader] Resolving %r" % (_buffer.decode())) chunk = json.loads(_buffer.decode("utf-8", "replace"))