mirror of
https://github.com/nexy7574/LCC-bot.git
synced 2024-09-19 10:03:40 +01:00
Fix stream reader
This commit is contained in:
parent
a5fce88e2a
commit
f492f2e05f
1 changed files with 1 additions and 0 deletions
|
@ -99,6 +99,7 @@ async def ollama_stream_reader(response: httpx.Response) -> typing.AsyncGenerato
|
|||
while not _buffer.endswith(b"}\n"):
|
||||
async for char in stream:
|
||||
_buffer += char
|
||||
_buffer = _buffer.rstrip()
|
||||
log.debug("Resolving %r", _buffer.decode())
|
||||
chunk = json.loads(_buffer.decode("utf-8", "replace"))
|
||||
log.debug("%r -> %r", _buffer.decode(), chunk)
|
||||
|
|
Loading…
Reference in a new issue