mirror of
https://github.com/nexy7574/LCC-bot.git
synced 2024-09-19 18:16:34 +01:00
Decrease verbosity
This commit is contained in:
parent
e0e8ed8b0e
commit
d12ec1b31a
1 changed files with 3 additions and 1 deletions
|
@ -1902,6 +1902,7 @@ class OtherCog(commands.Cog):
|
||||||
if response.status_code != 200:
|
if response.status_code != 200:
|
||||||
error = await response.aread()
|
error = await response.aread()
|
||||||
return await msg.edit(content="Failed to download model: `%s`" % error.decode())
|
return await msg.edit(content="Failed to download model: `%s`" % error.decode())
|
||||||
|
progresses = [5, 10, 20, 30, 40, 50, 60, 70, 80, 90, 95, 99, 100]
|
||||||
async for chunk in ollama_stream_reader(response):
|
async for chunk in ollama_stream_reader(response):
|
||||||
print(chunk)
|
print(chunk)
|
||||||
if "total" in chunk and "completed" in chunk:
|
if "total" in chunk and "completed" in chunk:
|
||||||
|
@ -1912,11 +1913,12 @@ class OtherCog(commands.Cog):
|
||||||
percent = round(completed / total * 100, 2)
|
percent = round(completed / total * 100, 2)
|
||||||
total_gigabytes = total / 1024 / 1024 / 1024
|
total_gigabytes = total / 1024 / 1024 / 1024
|
||||||
completed_gigabytes = completed / 1024 / 1024 / 1024
|
completed_gigabytes = completed / 1024 / 1024 / 1024
|
||||||
if (completed / total * 100) % 10 == 0 or percent >= 90.5:
|
if percent in progresses:
|
||||||
await msg.edit(
|
await msg.edit(
|
||||||
content=f"`{chunk['status']}` - {percent}% "
|
content=f"`{chunk['status']}` - {percent}% "
|
||||||
f"({completed_gigabytes:,.2f}GB/{total_gigabytes:,.2f}GB)"
|
f"({completed_gigabytes:,.2f}GB/{total_gigabytes:,.2f}GB)"
|
||||||
)
|
)
|
||||||
|
progresses.pop()
|
||||||
else:
|
else:
|
||||||
await msg.edit(content=f"`{chunk['status']}`")
|
await msg.edit(content=f"`{chunk['status']}`")
|
||||||
await msg.edit(content=f"Downloaded model {model}.")
|
await msg.edit(content=f"Downloaded model {model}.")
|
||||||
|
|
Loading…
Reference in a new issue