mirror of
https://github.com/nexy7574/LCC-bot.git
synced 2024-09-19 10:03:40 +01:00
wtf man
This commit is contained in:
parent
a6e92a44af
commit
0f9fc8b7b9
1 changed files with 5 additions and 3 deletions
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue