mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-07 21:24:59 +00:00
fixes #1240
This commit is contained in:
parent
130579ea3c
commit
725b06acd6
1 changed files with 5 additions and 1 deletions
|
@ -589,7 +589,11 @@ class Model(ModelSettings):
|
||||||
else:
|
else:
|
||||||
msgs = json.dumps(messages)
|
msgs = json.dumps(messages)
|
||||||
|
|
||||||
return len(self.tokenizer(msgs))
|
try:
|
||||||
|
return len(self.tokenizer(msgs))
|
||||||
|
except Exception as err:
|
||||||
|
print(f"Unable to count tokens: {err}")
|
||||||
|
return 0
|
||||||
|
|
||||||
def token_count_for_image(self, fname):
|
def token_count_for_image(self, fname):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue