Log download progress to console
This commit is contained in:
parent
5ac83dd939
commit
086dffd88c
1 changed files with 10 additions and 1 deletions
|
@ -82,6 +82,13 @@ class OllamaDownloadHandler:
|
||||||
def abort(self):
|
def abort(self):
|
||||||
self._abort.set()
|
self._abort.set()
|
||||||
|
|
||||||
|
def __enter__(self):
|
||||||
|
self._abort.clear()
|
||||||
|
return self
|
||||||
|
|
||||||
|
def __exit__(self, exc_type, exc_val, exc_tb):
|
||||||
|
self._abort.set()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def percent(self) -> float:
|
def percent(self) -> float:
|
||||||
return round((self._completed / self._total) * 100, 2)
|
return round((self._completed / self._total) * 100, 2)
|
||||||
|
@ -946,7 +953,9 @@ class Ollama(commands.Cog):
|
||||||
|
|
||||||
client = OllamaClient(CONFIG["ollama"][server]["base_url"])
|
client = OllamaClient(CONFIG["ollama"][server]["base_url"])
|
||||||
if not await client.has_model_named("orca-mini", "3b"):
|
if not await client.has_model_named("orca-mini", "3b"):
|
||||||
await client.download_model("orca-mini", "3b")
|
with client.download_model("orca-mini", "3b") as handler:
|
||||||
|
async for _ in handler:
|
||||||
|
self.log.info("Downloading orca-mini:3b on server %r - %.2f%", server, handler.percent)
|
||||||
|
|
||||||
messages = self.history.get_history(thread)
|
messages = self.history.get_history(thread)
|
||||||
embed = discord.Embed(description=">>> ")
|
embed = discord.Embed(description=">>> ")
|
||||||
|
|
Loading…
Reference in a new issue