Repository navigation
Conversation
This branch has not been deployed
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.
Problem
Tencent's WeMM-Video checkpoints extend Qwen3.5 with a Whisper encoder and windowed Q-Former. Dense checkpoints still advertise
qwen3_5, so the existing loader misses the audio architecture and synchronized video/audio preprocessing.Solution
Add native MLX WeMM-Video support for text, image, audio, video, and video-with-audio inputs, producing text. Reuse the dense/MoE Qwen3.5 backbones, implement the Whisper/Q-Former path, and preserve video paths for soundtrack extraction and timestamp alignment. Include checkpoint conversion, processor dispatch, usage examples, and shared parameterized model/processor tests. Dense and MoE configurations reuse the JSON model cases; loading and serialization share coverage with Qwen processors. Tests use generated inputs without checked-in reference fixtures. Use
model_type: wemm_videofor normalized MLX checkpoint configs and register the processor through the existinginstall_auto_processor_patchhelper. Remove upstreamauto_mapentries during normalization.get_model_type,load_processor, andmodels/base.pyretain their original implementations; the only shared utility change preserves video paths and metadata for processors that handle their own video loading. Tencent source configs must be normalized locally before loading or conversion; the model README includes the steps. The native processor loads without prompting to execute upstream code.Validation
pytest -q mlx_vlm/tests/test_processors.py mlx_vlm/tests/test_generate.py \ mlx_vlm/tests/test_models.py::test_model_contract \ mlx_vlm/tests/test_models.py::test_hybrid_backbone_sanitize_is_idempotent \ mlx_vlm/tests/test_models.py::test_media_features_follow_placeholder_order \ mlx_vlm/tests/test_models.py::test_get_model_and_args_routes_checkpoint_architectures \ -k 'not embedding_gemma2'Limits
The unit tests do not include a stored upstream numerical-parity fixture; reference comparisons above were separate validation runs. These are functional smoke checks, not a standardized accuracy benchmark or full-family reference parity. The 2B 4-bit export answered the arithmetic prompt incorrectly. The 4B 4-bit video-with-audio output repeated through both 512- and 2,048-token limits. The 9B 4-bit video-with-audio output was longer and stopped naturally at 575 tokens with the larger cap. BF16 and 8-bit avoided the arithmetic and repetition failures on these examples, but recognition errors remain. The default conversion keeps the vision/audio encoders in BF16.
EmbeddingGemma2 has existing compatibility failures with the local Transformers 5.23 environment. The latest unfiltered processor/generation run had 13 such failures; all 13 were reproduced on the unchanged prior PR head. The current shared run excludes EmbeddingGemma2.