mirror of
https://github.com/nexy7574/LCC-bot.git
synced 2024-09-19 18:16:34 +01:00
cmon
This commit is contained in:
parent
10bb416fa1
commit
ff192c5b88
1 changed files with 6 additions and 1 deletions
|
@ -97,7 +97,12 @@ async def ollama_stream_reader(response: httpx.Response) -> typing.AsyncGenerato
|
||||||
while not _buffer.endswith(b"}\n"):
|
while not _buffer.endswith(b"}\n"):
|
||||||
async for char in stream:
|
async for char in stream:
|
||||||
_buffer += char
|
_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()
|
_buffer = _buffer.rstrip()
|
||||||
print("[ollama stream reader] Resolving %r" % (_buffer.decode()))
|
print("[ollama stream reader] Resolving %r" % (_buffer.decode()))
|
||||||
chunk = json.loads(_buffer.decode("utf-8", "replace"))
|
chunk = json.loads(_buffer.decode("utf-8", "replace"))
|
||||||
|
|
Loading…
Reference in a new issue