Decodes a list of tokens into a list of bytes. Useful for visualising tokenisation. >>> enc.decode_tokens_bytes([31373, 995]) [b'hello', b' world']
(self, tokens: Sequence[int])
| 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. |
| 305 | |
| 306 | Useful for visualising tokenisation. |
| 307 | >>> enc.decode_tokens_bytes([31373, 995]) |
| 308 | [b'hello', b' world'] |
| 309 | """ |
| 310 | return [self.decode_single_token_bytes(token) for token in tokens] |
| 311 | |
| 312 | def decode_with_offsets(self, tokens: Sequence[int]) -> tuple[str, list[int]]: |
| 313 | """Decodes a list of tokens into a string and a list of offsets. |
no test coverage detected