nemo_automodel.components.models.kimi_k3.tokenization
nemo_automodel.components.models.kimi_k3.tokenization
Module Contents
Classes
Functions
Data
API
Bases: PreTrainedTokenizer
Tokenizing and encoding/decoding text using the Tiktoken tokenizer. See megatron/tokenizer/tiktoken_tokenizer.py.
This tokenizer inherits from [PreTrainedTokenizer] which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.
Parameters:
The path to the Tiktoken model file.
The beginning of sequence token that was used during pretraining. Defaults to [BOS]. Can be used as a
sequence classifier token.
The end of sequence token. Defaults to [EOS].
The unknown token. A token that is not in the vocabulary cannot be converted to an ID and is set to be this
token instead. Defaults to None.
The token used for padding, for example when batching sequences of different lengths. Defaults to None.
A tuple or a list of additional tokens, which will be marked as special, meaning that they will be
skipped when decoding if skip_special_tokens is set to True.
Splits the string s so that each substring contains no more than max_consecutive_slice_len
consecutive whitespaces or consecutive non-whitespaces.
Decodes a list of token IDs into a string.
Parameters:
The list of token IDs to be decoded.
Returns: str
The decoded string.
Encodes a string into a list of token IDs.
Parameters:
The input string to be encoded.
Returns: List[int]
list[int]: A list of token IDs.
Build the Kimi K3 tiktoken regex without exposing raw set intersections to autodoc.