mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-24 14:25:00 +00:00
defend against no tokenizer
This commit is contained in:
parent
6c77c32d06
commit
4aba307ebd
1 changed files with 5 additions and 1 deletions
|
@ -436,7 +436,11 @@ class Coder:
|
|||
reminder_tokens = self.main_model.token_count(reminder_message)
|
||||
cur_tokens = self.main_model.token_count(self.cur_messages)
|
||||
|
||||
if None not in (messages_tokens, reminder_tokens, cur_tokens):
|
||||
total_tokens = messages_tokens + reminder_tokens + cur_tokens
|
||||
else:
|
||||
# add the reminder anyway
|
||||
total_tokens = 0
|
||||
|
||||
# Add the reminder prompt if we still have room to include it.
|
||||
if total_tokens < self.main_model.max_context_tokens:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue