Package ai.djl.huggingface.tokenizers
Class PadTokenResolver
java.lang.Object
ai.djl.huggingface.tokenizers.PadTokenResolver
The type Pad token resolver.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic PadTokenResolver.PadInfoextractPadInfo(String tokenizerJson, TokenizerConfig config) Extracts pad token and ID from tokenizer.json and/or tokenizer_config.json.
-
Method Details
-
extractPadInfo
Extracts pad token and ID from tokenizer.json and/or tokenizer_config.json. Follows HF behavior: tokenizer.json takes precedence, config is fallback.- Parameters:
tokenizerJson- tokenizer.json content as stringconfig- TokenizerConfig, may be null- Returns:
- PadInfo or null if pad token cannot be resolved
-