open-compass / open-compass/VLMEvalKit
More elegant way to distinguish qwen2vl and qwen2.5vl
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 4.4k
- Forks
- 768
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 17
Description
As I know, currently there is no model category for Qwen2_5VLChat, only Qwen2VLChat.
In config.py, the Qwen2.5VL series models also use Qwen2VLChat, but there are structural differences between the two series. The current implementation in the code judges the model type by checking whether the path contains "2.5" or similar conditions like:
if listinstr(['omni'], model_path.lower()):
try:
from transformers import Qwen2_5OmniForConditionalGeneration, Qwen2_5OmniProcessor
except Exception as err:
logging.critical("pip install git+https://github.com/huggingface/transformers@3a1ead0aabed473eafe527915eea8c197d424356") # noqa: E501
raise err
MODEL_CLS = Qwen2_5OmniForConditionalGeneration
self.processor = Qwen2_5OmniProcessor.from_pretrained(model_path)
elif listinstr(['2.5', '2_5', 'qwen25', 'mimo'], model_path.lower()):
from transformers import Qwen2_5_VLForConditionalGeneration, AutoProcessor
MODEL_CLS = Qwen2_5_VLForConditionalGeneration
self.processor = AutoProcessor.from_pretrained(model_path)
else:
from transformers import Qwen2VLForConditionalGeneration, Qwen2VLProcessor
MODEL_CLS = Qwen2VLForConditionalGeneration
self.processor = Qwen2VLProcessor.from_pretrained(model_path)
This approach may lack flexibility and could lead to errors.
In summary, are there any plans to implement a more elegant method to distinguish between the two series of models when loading them?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in _config.py and trace the model-loading branches for Qwen2VLChat and Qwen2.5VLChat. Compare the structural differences and current path-based checks, then validate loading behavior for both model series; done means the distinction no longer depends on fragile model-path naming and both series load their appropriate classes and processors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100