java.lang.Object
org.elasticsearch.xpack.core.ml.inference.trainedmodel.Tokenization
org.elasticsearch.xpack.core.ml.inference.trainedmodel.ByteLevelBpeTokenization
All Implemented Interfaces:
NamedWriteable, Writeable, ToXContent, ToXContentObject, NamedXContentObject

public class ByteLevelBpeTokenization extends Tokenization
Tokenization settings for byte-level BPE models (for example GPT-2 style vocabularies) that ship a merge table alongside the vocabulary. The in-process tokenizer applies UTF-8 byte mapping and BPE merges using the same engine as the RoBERTa tokenizer, but special token strings are configurable so deployments can align with Hugging Face tokenizer metadata. do_lower_case is not applied by the byte-level BPE analyzer and must not be set to true; requests that set it to true are rejected like RobertaTokenization. When with_special_tokens is true, the configured BOS and EOS strings must be present in the vocabulary; that requirement is enforced when the inference tokenizer is constructed for the model (not only in validateVocabulary(org.elasticsearch.xpack.core.ml.action.PutTrainedModelVocabularyAction.Request)), consistent with RobertaTokenization. The configured mask string is optional for encoding-only inference, and the mask token id may be unset if that token is missing from the vocabulary (masking-oriented tasks should ensure it exists).