Decodes a token into bytes. NOTE: this will decode all special tokens. Raises `KeyError` if the token is not in the vocabulary. ``` >>> enc.decode_single_token_bytes(31373) b'hello' ```
(self, token: int)
| 287 | return self._core_bpe.decode_bytes(tokens).decode("utf-8", errors=errors) |
| 288 | |
| 289 | def decode_single_token_bytes(self, token: int) -> bytes: |
| 290 | """Decodes a token into bytes. |
| 291 | |
| 292 | NOTE: this will decode all special tokens. |
| 293 | |
| 294 | Raises `KeyError` if the token is not in the vocabulary. |
| 295 | |
| 296 | ``` |
| 297 | >>> enc.decode_single_token_bytes(31373) |
| 298 | b'hello' |
| 299 | ``` |
| 300 | """ |
| 301 | return self._core_bpe.decode_single_token_bytes(token) |
| 302 | |
| 303 | def decode_tokens_bytes(self, tokens: Sequence[int]) -> list[bytes]: |
| 304 | """Decodes a list of tokens into a list of bytes. |
no outgoing calls