MCPcopy Create free account
hub / github.com/apple/axlearn / encode

Method encode

axlearn/common/input_grain_text.py:34–36  ·  view source on GitHub ↗

Tokenizes string to an int sequence.

(self, s: str)

Source from the content-addressed store, hash-verified

32 """BOS token ID."""
33
34 def encode(self, s: str) -> Sequence[int]:
35 """Tokenizes string to an int sequence."""
36 raise NotImplementedError(type(self))
37
38 # This API is useful for e.g. `num_bytes`.
39 def _decode(self, ids: Sequence[int]) -> str:

Callers 15

create_forMethod · 0.45
construct_node_pool_nameFunction · 0.45
execute_commandMethod · 0.45
do_GETMethod · 0.45
test_decode_fake_dataMethod · 0.45
_test_num_bytesMethod · 0.45

Calls

no outgoing calls

Tested by 12

execute_commandMethod · 0.36
do_GETMethod · 0.36
test_decode_fake_dataMethod · 0.36
_test_num_bytesMethod · 0.36
test_log_configMethod · 0.36