Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Qwen2.5 VL legacy models with newest transformers #115

Merged
merged 4 commits into from
Mar 6, 2025

Conversation

neilmehta24
Copy link
Member

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, create Qwen2_5_VLImageProcessor when we detect we are loading a model with Qwen2_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

@github-actions github-actions bot added the CLA signed Indicates that all contributors have signed label Mar 5, 2025
@neilmehta24 neilmehta24 force-pushed the neil/outlines-refactor branch from da73242 to 4c82c05 Compare March 5, 2025 20:55
@neilmehta24 neilmehta24 force-pushed the neil/mlx-vlm-qwen2.5-transformers-fix branch from 544b4d1 to 3f24854 Compare March 5, 2025 20:55
@neilmehta24 neilmehta24 requested a review from mattjcly March 5, 2025 21:13
Base automatically changed from neil/outlines-refactor to main March 6, 2025 15:55
Co-authored-by: Matt Clayton <[email protected]>
@neilmehta24 neilmehta24 merged commit 5e54151 into main Mar 6, 2025
1 check passed
@github-actions github-actions bot locked and limited conversation to collaborators Mar 6, 2025
@neilmehta24 neilmehta24 deleted the neil/mlx-vlm-qwen2.5-transformers-fix branch March 8, 2025 19:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CLA signed Indicates that all contributors have signed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants