MCPcopy Create free account
hub / github.com/M4THYOU/TokenDagger / encode_ordinary

Method encode_ordinary

tokendagger/wrapper.py:145–157  ·  view source on GitHub ↗

Encode text using ordinary tokens only (no special tokens). Args: text: Text to encode Returns: List of token IDs

(self, text: str)

Source from the content-addressed store, hash-verified

143 # ====================
144
145 def encode_ordinary(self, text: str) -> list[int]:
146 """Encode text using ordinary tokens only (no special tokens).
147
148 Args:
149 text: Text to encode
150
151 Returns:
152 List of token IDs
153 """
154 try:
155 return self._core_bpe.encode_ordinary(text)
156 except Exception as e:
157 raise TokenDaggerError(f"Encoding failed: {e}")
158
159 def encode(
160 self,

Callers 3

autogenned_test.pyFile · 0.45
compare_encodingMethod · 0.45
run_roundtrip_testsMethod · 0.45

Calls 1

TokenDaggerErrorClass · 0.85

Tested by 2

compare_encodingMethod · 0.36
run_roundtrip_testsMethod · 0.36