fix: Remove all_special_tokens_extended for transformers v5 compatibility in OpenAI frontend#8817
Merged
Conversation
whoisj
approved these changes
Jun 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does the PR do?
Removes the cached
all_special_tokens_extendedproperty from the OpenAI frontend tokenizer helper. This attribute was removed intransformersv5 (thePreTrainedTokenizer*classes were replaced by backend classes such asTokenizersBackend), so accessing it raisesAttributeError: TokenizersBackend has no attribute all_special_tokens_extendedand crashes the OpenAI frontend on startup.The attribute is equivalent to
all_special_tokens, is not used anywhere in the frontend, and removing it restores forward compatibility withtransformersv5 (the vLLM test container currently shipstransformers 5.6.0). This mirrors the equivalent upstream change in vLLM (vllm-project/vllm#29686).Checklist
<commit_type>: <Title>Commit Type:
Related PRs:
Where should the reviewer start?
python/openai/openai_frontend/engine/utils/tokenizer.py— theget_cached_tokenizer()function (removed theall_special_tokens_extendedread and its cached@property).Test plan:
Caveats:
HuggingFace documents
_special_tokens_map/_extra_special_tokensas the v5 replacements for the extended special-token maps, but those are not needed here since the value was only an alias ofall_special_tokensand is unused by the frontend.Background
The vLLM test container was upgraded to
transformers >= 5.0.0(currently 5.6.0).transformersv5 removedspecial_tokens_map_extendedandall_special_tokens_extended(huggingface/transformers#40936, v5 tokenization migration guide). This frontend tokenizer helper was adapted from older vLLM code and still referenced the removed attribute.Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)