mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-03 11:14:59 +00:00
refactor: Use 1024 instead of 1000 for token budget formatting
This commit is contained in:
parent
67ebb2566d
commit
935227f7e7
1 changed files with 3 additions and 3 deletions
|
@ -220,14 +220,14 @@ class Coder:
|
|||
):
|
||||
budget = main_model.extra_params["thinking"]["budget_tokens"]
|
||||
# Format as xx.yK for thousands, xx.yM for millions
|
||||
if budget >= 1000000:
|
||||
value = budget / 1000000
|
||||
if budget >= 1024 * 1024:
|
||||
value = budget / (1024 * 1024)
|
||||
if value == int(value):
|
||||
formatted_budget = f"{int(value)}M"
|
||||
else:
|
||||
formatted_budget = f"{value:.1f}M"
|
||||
else:
|
||||
value = budget / 1000
|
||||
value = budget / 1024
|
||||
if value == int(value):
|
||||
formatted_budget = f"{int(value)}k"
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue