Fall back to AutoModelForImageTextToText when AutoModelForVision2Seq is absent - #1676
Open
rrrxxx0510 wants to merge 2 commits into
Open
rrrxxx0510 wants to merge 2 commits into
rrrxxx0510 wants to merge 2 commits into
Conversation
rrrxxx0510
force-pushed
the
fix/vision2seq-import-transformers-5
branch
from
September 14, 2026 11:40
d4bab98 to
0b8aaf3
Compare
…is absent
AutoModelForVision2Seq was removed in transformers 5.x (renamed to
AutoModelForImageTextToText), so DOCLING, IDEFICS2, Mantis and XGenMM
fail at import time on recent transformers:
ImportError: cannot import name 'AutoModelForVision2Seq'
granite_vision already handles this with an ImportError fallback
(open-compass#1404); apply the same pattern to the four remaining model wrappers.
Also raise in Mantis' generic except branch, which previously logged
and continued, leaving AutoModelForVision2Seq undefined and crashing
later with a confusing NameError.
rrrxxx0510
force-pushed
the
fix/vision2seq-import-transformers-5
branch
from
September 18, 2026 03:24
0b8aaf3 to
a10041e
Compare
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.
Fixes #1675
AutoModelForVision2Seqwas removed in transformers 5.x (renamed toAutoModelForImageTextToText), so DOCLING, IDEFICS2, Mantis and XGenMM fail at import time on recent transformers:granite_visionalready handles this with an ImportError fallback (#1404); this applies the same pattern to the four remaining model wrappers. Also raises in Mantis' generic except branch, which previously logged and continued — leavingAutoModelForVision2Sequndefined and crashing later with a confusing NameError.Verified on transformers 5.16: the old import raises the ImportError above, the fallback import works.