MCPcopy Create free account
hub / github.com/THUDM/AgentTuning / __init__

Method __init__

eval_heldout/webarena/llms/tokenizers.py:7–11  ·  view source on GitHub ↗
(self, model_name: str)

Source from the content-addressed store, hash-verified

5
6class Tokenizer(object):
7 def __init__(self, model_name: str) -> None:
8 if model_name in ["gpt-4", "gpt-turbo-3.5"]:
9 self.tokenizer = tiktoken.encoding_for_model(model_name)
10 else:
11 raise NotImplementedError
12
13 def __call__(self, text: str) -> list[int]:
14 return self.tokenizer.encode(text)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected