mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 00:35:00 +00:00
handle missing max_map_tokens/max_context_window
This commit is contained in:
parent
6345cd3734
commit
a4a6066858
1 changed files with 4 additions and 1 deletions
|
@ -72,7 +72,10 @@ class RepoMap:
|
|||
# With no files in the chat, give a bigger view of the entire repo
|
||||
MUL = 16
|
||||
padding = 4096
|
||||
target = min(max_map_tokens * MUL, self.max_context_window - padding)
|
||||
if max_map_tokens and self.max_context_window:
|
||||
target = min(max_map_tokens * MUL, self.max_context_window - padding)
|
||||
else:
|
||||
target = 0
|
||||
if not chat_files and self.max_context_window and target > 0:
|
||||
max_map_tokens = target
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue