From 0f9fc8b7b982ca05028a4e708178a379e3688169 Mon Sep 17 00:00:00 2001 From: nex Date: Fri, 10 Nov 2023 23:29:23 +0000 Subject: [PATCH] wtf man --- cogs/other.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cogs/other.py b/cogs/other.py index cae8a5f..9da42e2 100644 --- a/cogs/other.py +++ b/cogs/other.py @@ -92,12 +92,14 @@ async def ollama_stream_reader(response: httpx.Response) -> typing.AsyncGenerato ]: _buffer = b"" async for char in response.aiter_bytes(1): - while not _buffer.endswith(b"}\n"): + while not _buffer.endswith(b"\n"): _buffer += char print( - "Read {:,} bytes in chunk for a total of {:,} bytes in buffer.".format( + "Read {:,} bytes ({!r}) in chunk for a total of {:,} bytes in buffer ({!r}).".format( len(char), - len(_buffer) + char, + len(_buffer), + _buffer ) ) _buffer = _buffer.rstrip()