Fix Qwen2.5 VL legacy models with newest transformers #115
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.
The gist is that the newest release of transformers deleted the
Qwen2_5_VLImageProcessor
class, so models that were already downloaded no longer work with the newest transformers. To fix, createQwen2_5_VLImageProcessor
when we detect we are loading a model withQwen2_5_VLImageProcessor
image processor.I tested to make sure that this works with the new model config and the old model config.
See these two sources for more detail:
Blaizzy/mlx-vlm#209 (comment)
https://huggingface.co/mlx-community/Qwen2.5-VL-7B-Instruct-4bit/commit/fdcc572e8b05ba9daeaf71be8c9e4267c826ff9b