mirror of
https://github.com/nexy7574/LCC-bot.git
synced 2024-09-19 18:16:34 +01:00
Even more verboseeeee!
This commit is contained in:
parent
b0884040df
commit
10bb416fa1
1 changed files with 4 additions and 2 deletions
|
@ -97,6 +97,7 @@ 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))
|
||||||
_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"))
|
||||||
|
@ -1837,7 +1838,7 @@ class OtherCog(commands.Cog):
|
||||||
async with client.stream(
|
async with client.stream(
|
||||||
"POST",
|
"POST",
|
||||||
"/pull",
|
"/pull",
|
||||||
json={"name": model},
|
json={"name": model, "stream": True},
|
||||||
timeout=None
|
timeout=None
|
||||||
) as response:
|
) as response:
|
||||||
if response.status_code != 200:
|
if response.status_code != 200:
|
||||||
|
@ -1872,7 +1873,8 @@ class OtherCog(commands.Cog):
|
||||||
"format": "json",
|
"format": "json",
|
||||||
"system": "You are a discord bot called Jimmy Saville. "
|
"system": "You are a discord bot called Jimmy Saville. "
|
||||||
"Be helpful and make sure your response is safe for work, "
|
"Be helpful and make sure your response is safe for work, "
|
||||||
"and is less than 3500 characters"
|
"and is less than 3500 characters",
|
||||||
|
"stream": True
|
||||||
},
|
},
|
||||||
timeout=None
|
timeout=None
|
||||||
) as response:
|
) as response:
|
||||||
|
|
Loading…
Reference in a new issue