mirror of
https://github.com/nexy7574/LCC-bot.git
synced 2024-09-19 18:16:34 +01:00
Debug ollama more!
This commit is contained in:
parent
0848cdcc0b
commit
9784b65b1c
1 changed files with 3 additions and 1 deletions
|
@ -93,7 +93,9 @@ async def ollama_stream_reader(response: httpx.Response) -> typing.AsyncGenerato
|
||||||
async for chunk in response.aiter_bytes(8192):
|
async for chunk in response.aiter_bytes(8192):
|
||||||
# Each chunk is a JSON string
|
# Each chunk is a JSON string
|
||||||
try:
|
try:
|
||||||
yield json.loads(chunk.strip().decode("utf-8", "replace"))
|
loaded = json.loads(chunk.strip().decode("utf-8", "replace"))
|
||||||
|
print("Loaded chunk: %r", loaded)
|
||||||
|
yield loaded
|
||||||
except json.JSONDecodeError as e:
|
except json.JSONDecodeError as e:
|
||||||
print("Failed to decode chunk %r: %r" % (chunk, e), file=sys.stderr)
|
print("Failed to decode chunk %r: %r" % (chunk, e), file=sys.stderr)
|
||||||
pass
|
pass
|
||||||
|
|
Loading…
Reference in a new issue