mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-01 18:25:00 +00:00
style: Improve formatting of cache warming message
This commit is contained in:
parent
a6ff08b2c5
commit
75a51025a0
1 changed files with 6 additions and 3 deletions
|
@ -1013,7 +1013,7 @@ class Coder:
|
||||||
cache_hit_tokens = getattr(
|
cache_hit_tokens = getattr(
|
||||||
completion.usage, "prompt_cache_hit_tokens", 0
|
completion.usage, "prompt_cache_hit_tokens", 0
|
||||||
) or getattr(completion.usage, "cache_read_input_tokens", 0)
|
) or getattr(completion.usage, "cache_read_input_tokens", 0)
|
||||||
|
|
||||||
def format_tokens(count):
|
def format_tokens(count):
|
||||||
if count < 1000:
|
if count < 1000:
|
||||||
return f"{count}"
|
return f"{count}"
|
||||||
|
@ -1021,8 +1021,11 @@ class Coder:
|
||||||
return f"{count / 1000:.1f}k"
|
return f"{count / 1000:.1f}k"
|
||||||
else:
|
else:
|
||||||
return f"{round(count / 1000)}k"
|
return f"{round(count / 1000)}k"
|
||||||
|
|
||||||
self.io.tool_output(f"Warmed {format_tokens(cache_hit_tokens)} cached tokens. ({i+1}/{self.num_cache_warming_pings})")
|
self.io.tool_output(
|
||||||
|
f"Warmed {format_tokens(cache_hit_tokens)} cached tokens."
|
||||||
|
f" ({i+1}/{self.num_cache_warming_pings})"
|
||||||
|
)
|
||||||
|
|
||||||
self.io.tool_output("Stopped warming.")
|
self.io.tool_output("Stopped warming.")
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue