[Bug] HCXVisionV2Processor image_token mismatch with chat_template
#3
by
kaki-paper
- opened
Summary
HCXVisionV2Processor inherits from Qwen2_5_VLProcessor but doesn't override the image_token and video_token properties, causing a case mismatch that breaks image/video processing in frameworks like vLLM.
Details
| Component | Token |
|---|---|
| chat_template.jinja | <|IMAGE_PAD|> (uppercase) |
| added_tokens.json | <|IMAGE_PAD|> (uppercase) |
| Qwen2_5_VLProcessor.image_token | <|image_pad|> (lowercase) |
Since HCXVisionV2Processor extends Qwen2_5_VLProcessor without overriding the image_token property, it inherits the lowercase version. This causes token expansion to fail because the processor looks for lowercase tokens but the prompt contains uppercase tokens.
Reproduction
When using the HF processor to expand image tokens:
# In Qwen2_5_VLProcessor._expand_image_tokens:
while self.image_token in text[i]: # Looking for "<|image_pad|>"
# But text has "<|IMAGE_PAD|>" from chat_template
# → Never matches → No expansion