forked from phoenix/litellm-mirror
feat(router.py): enable pre-call checks
filter models outside of context window limits of a given message for a model group https://github.com/BerriAI/litellm/issues/872
This commit is contained in:
parent
2fabff06c0
commit
eb3ca85d7e
7 changed files with 3417 additions and 526 deletions
|
@ -3605,7 +3605,7 @@ def token_counter(
|
|||
count_response_tokens=count_response_tokens,
|
||||
)
|
||||
else:
|
||||
num_tokens = len(encoding.encode(text)) # type: ignore
|
||||
num_tokens = len(encoding.encode(text, disallowed_special=())) # type: ignore
|
||||
return num_tokens
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue