mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-31 09:44:59 +00:00
feat: use the format_tokens in utils.py in warm_cache_worker
This commit is contained in:
parent
bd9e6d7f58
commit
f5da41216c
1 changed files with 1 additions and 9 deletions
|
@ -1015,16 +1015,8 @@ class Coder:
|
||||||
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):
|
|
||||||
if count < 1000:
|
|
||||||
return f"{count}"
|
|
||||||
elif count < 10000:
|
|
||||||
return f"{count / 1000:.1f}k"
|
|
||||||
else:
|
|
||||||
return f"{round(count / 1000)}k"
|
|
||||||
|
|
||||||
self.io.tool_output(
|
self.io.tool_output(
|
||||||
f"Warmed {format_tokens(cache_hit_tokens)} cached tokens."
|
f"Warmed {utils.format_tokens(cache_hit_tokens)} cached tokens."
|
||||||
f" ({i+1}/{self.num_cache_warming_pings})"
|
f" ({i+1}/{self.num_cache_warming_pings})"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue