vllm.tokenizers ¶
Modules:
-
deepseek_v32– -
deepseek_v4– -
deepseek_v4_encoding–DeepSeek-V4 Encoding
-
detokenizer_utils– -
fastokens–fastokensbackend patch. -
grok2–Tokenizer for Grok-2 .tok.json format.
-
hf– -
kimi_audio–Tokenizer for Kimi-Audio using TikToken.
-
mistral– -
qwen_vl– -
registry–
Functions:
-
get_tokenizer–Gets a tokenizer for the given model name via HuggingFace or ModelScope.
-
maybe_make_thread_pool–If
tokenizeris aPreTrainedTokenizerFast, modify the tokenizer
get_tokenizer(tokenizer_name, *args, tokenizer_cls=TokenizerLike, trust_remote_code=False, revision=None, download_dir=None, **kwargs) ¶
Gets a tokenizer for the given model name via HuggingFace or ModelScope.
Source code in vllm/tokenizers/registry.py
maybe_make_thread_pool(tokenizer, copies=1) ¶
If tokenizer is a PreTrainedTokenizerFast, modify the tokenizer in-place to make the public interface thread-safe by routing calls through a deep-copied tokenizer pool.
Note that: - Only TokenizerLike's public interface is thread-safe. This doesn't include _tokenizer property nor any mutation methods like add_special_tokens or add_tokens. - Adjacent method calls could happen on different deep copies.