MCPcopy 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

45llama_tokenizer = Tokenizer.from_pretrained('THUDM/agentlm-70b')
46
47def token_count(text):
48 return len(tokenizer.encode(text))
49
50def get_prompt(conv: Conversation) -> str:
51 if conv.name == 'openchat':

Callers 1

call_llmMethod · 0.85

Calls 1

encodeMethod · 0.80

Tested by

no test coverage detected