[CI/Build][Bugfix] Ensure compatibility with transformers 4.52 (#18678)
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
This commit is contained in:
@@ -111,7 +111,13 @@ class AyaVisionProcessingInfo(BaseProcessingInfo):
|
||||
return self.ctx.get_hf_config(AyaVisionConfig)
|
||||
|
||||
def get_hf_processor(self, **kwargs: object) -> AyaVisionProcessor:
|
||||
return self.ctx.get_hf_processor(AyaVisionProcessor, **kwargs)
|
||||
processor = self.ctx.get_hf_processor(AyaVisionProcessor, **kwargs)
|
||||
|
||||
# Temporary workaround since this processor has multiple image tokens
|
||||
# See https://github.com/huggingface/transformers/issues/38350
|
||||
processor._check_special_mm_tokens = lambda *args, **kwargs: None
|
||||
|
||||
return processor
|
||||
|
||||
def get_image_processor(self) -> GotOcr2ImageProcessor:
|
||||
return self.get_hf_processor().image_processor
|
||||
@@ -188,9 +194,7 @@ class AyaVisionMultiModalProcessor(
|
||||
image_processor = hf_processor.image_processor
|
||||
|
||||
# HF processor pops the `num_patches` kwarg, which is needed by vLLM
|
||||
if (images :=
|
||||
mm_data.get("images")) is not None and '<image>' in prompt:
|
||||
assert isinstance(images, list)
|
||||
if (images := mm_data.get("images")) is not None:
|
||||
parsed_images = (self._get_data_parser().parse_mm_data({
|
||||
"image":
|
||||
images
|
||||
|
||||
Reference in New Issue
Block a user