mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-05-04 22:50:54 +00:00
projects preps
This commit is contained in:
parent
2611de3212
commit
c4bf352d9c
9 changed files with 236 additions and 4 deletions
|
|
@ -13,7 +13,7 @@ def count_tokens(text: str, encoding_name="cl100k_base") -> int:
|
|||
encoding = tiktoken.get_encoding(encoding_name)
|
||||
|
||||
# Encode the text and count the tokens
|
||||
tokens = encoding.encode(text)
|
||||
tokens = encoding.encode(text, disallowed_special=())
|
||||
token_count = len(tokens)
|
||||
|
||||
return token_count
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue