Optionally use Qwen VL driven REPA instead of DINO - #2831
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds optional support for using Qwen-VL (via Hugging Face Transformers) as the feature encoder for CREPA/REPA regularization, alongside the existing DINOv2 torch.hub encoders, and updates the CLI/UI documentation to reflect the new options and aliases.
Changes:
- Added a
QwenVLVisionEncoderadapter and encoder selection logic to load Qwen-VL models when a Qwen-VL alias/model id is provided. - Updated preprocessing flow so encoders that self-preprocess (Qwen-VL) bypass the DINO-specific resize/normalize path.
- Extended documentation (all languages) and added unit tests with Qwen-VL stubs/mocks.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| simpletuner/helpers/training/crepa.py | Adds Qwen-VL adapter + aliasing, encoder loading switch, and preprocess gating for CREPA encoders. |
| tests/test_crepa.py | Adds Qwen-VL unit tests using dummy processor/model and unittest.mock.patch. |
| simpletuner/simpletuner_sdk/server/services/field_registry/sections/loss.py | Updates WebUI field help/tooltip text to reflect Qwen-VL support and encoder-agnostic batching. |
| documentation/OPTIONS.md | Documents Qwen-VL as an alternative --crepa_model option and updates examples. |
| documentation/OPTIONS.es.md | Spanish translation updates for Qwen-VL CREPA encoder options/examples. |
| documentation/OPTIONS.pt-BR.md | Portuguese (Brazil) translation updates for Qwen-VL CREPA encoder options/examples. |
| documentation/OPTIONS.zh.md | Chinese translation updates for Qwen-VL CREPA encoder options/examples. |
| documentation/OPTIONS.ja.md | Japanese translation updates for Qwen-VL CREPA encoder options/examples. |
| documentation/OPTIONS.hi.md | Hindi translation updates for Qwen-VL CREPA encoder options/examples. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Closes #2247
This pull request adds support for using Qwen-VL vision-language models as feature encoders for CREPA regularization, in addition to the existing DINOv2 models. It introduces a new
QwenVLVisionEncoderadapter, updates documentation in multiple languages to explain and reference Qwen-VL options, and improves alias handling and tooltips for model selection. Unit tests are extended with Qwen-VL stubs to facilitate testing.CREPA Qwen-VL Vision Encoder Support:
QwenVLVisionEncoderclass tocrepa.py, allowing CREPA to extract visual features from Qwen-VL models (including Qwen3 and Qwen2.5 variants) using the Hugging Face Transformers interface. This includes methods for loading, preprocessing, and feature extraction.QwenVLVisionEncoderwhen a Qwen-VL model alias or id is provided, and to handle dtype and preprocessing appropriately. [1] [2] [3]Documentation Updates (All Languages):
OPTIONS.mdand translations) to describe Qwen-VL as an alternative to DINOv2 for--crepa_model, including new options, rationale, and example usage. [1] [2] [3] [4] [5] [6]SDK/Field Registry UI Improvements:
crepa_modelfield to reflect Qwen-VL support and clarify usage in the field registry.crepa_encoder_frames_batch_sizeto be encoder-agnostic.Testing Enhancements: