🚨Deprecate legacy argument for image-text-to-text models and adopt new behavior by default #36307
+2
−34
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 this PR do?
The legacy kwarg, behavior and the corresponding warnings have been out in the library for a while. The original deprecation version was 5.0.0, but as it is causing issues with remote_code models such as #36106 amongst others, it might be time to remove it now?
Other issue, the kwarg was removed from the image-text-to-text pipeline (inadvertently by me 😐) where it should be set to False by default, so right now the behavior in the pipeline for model that do use the legacy argument is not as it should be.
The models using the legacy kwarg are the following: Donut, Git, Pix2Struct.
They are quite old models, and hopefully users have had the time to see the deprecation warnings, but putting 🚨 as it will still change some default behaviors.