fix: transformers v5 compatibility for AUTOMODEL_CAUSALLM VLMs#3276
Merged
PeterStaar-IBM merged 1 commit intodocling-project:mainfrom Apr 13, 2026
Merged
fix: transformers v5 compatibility for AUTOMODEL_CAUSALLM VLMs#3276PeterStaar-IBM merged 1 commit intodocling-project:mainfrom
PeterStaar-IBM merged 1 commit intodocling-project:mainfrom
Conversation
…ng-project#3273) In transformers v5, AutoProcessor.from_pretrained returns a TokenizersBackend directly for pure-tokenizer processors (e.g. Falcon-OCR with AUTOMODEL_CAUSALLM), which has no .tokenizer attribute. Resolve the tokenizer via a helper that falls back to the processor itself so both v4 wrapper processors and v5 TokenizersBackend shapes are supported. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Georg Heiler <georg.kf.heiler@gmail.com>
Contributor
Merge ProtectionsYour pull request matches the following merge protections and will not be merged until they are valid. 🟢 Enforce conventional commitWonderful, this rule succeeded.Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
|
Contributor
|
✅ DCO Check Passed Thanks @geoHeil, all your commits are properly signed off. 🎉 |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
PeterStaar-IBM
approved these changes
Apr 13, 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.
Summary
VlmPipeline+TransformersVlmEnginecrashes on transformers v5 when loading AUTOMODEL_CAUSALLM VLMs (e.g.tiiuae/Falcon-OCR) withAttributeError: TokenizersBackend has no attribute tokenizer.AutoProcessor.from_pretrainedreturns aTokenizersBackenddirectly for pure-tokenizer processors — it exposes_tokenizer, nottokenizer._get_tokenizer()that returnsprocessor.tokenizerwhen present and otherwise falls back to the processor itself, so both v4 wrapper-processors and v5TokenizersBackendshapes work. Guardpadding_side/pad_tokenaccesses withgetattr/hasattr.Test plan
VlmPipelinewithfalcon_ocrpreset initializes and converts a sample PDF on transformers v5🤖 Generated with Claude Code