Skip to content

Tokenizer

latent_space.models.tokenizer

TokenSpan

Bases: BaseModel

One GPT-2 token: its id and the characters attributed to it.

text is empty for a token that holds only continuation bytes of a multi-byte character (e.g. part of an emoji); that character is attributed to the token holding its first byte, keeping the joined text lossless.