Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/THUDM/AgentTuning
/ token_count
Function
token_count
eval_heldout/rewoo/nodes/LLMNode.py:47–48 ·
view source on GitHub ↗
(text)
Source
from the content-addressed store, hash-verified
45
llama_tokenizer = Tokenizer.from_pretrained(
'THUDM/agentlm-70b'
)
46
47
def
token_count(text):
48
return
len(tokenizer.encode(text))
49
50
def
get_prompt(conv: Conversation) -> str:
51
if
conv.name ==
'openchat'
:
Callers
1
call_llm
Method · 0.85
Calls
1
encode
Method · 0.80
Tested by
no test coverage detected