Skip to content

Commit

Permalink
Fix MiniCPM-V/o
Browse files Browse the repository at this point in the history
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
  • Loading branch information
DarkLight1337 committed Feb 5, 2025
1 parent 4b6cbb7 commit e8616d7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions vllm/model_executor/models/minicpmv.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,15 @@ def get_hf_processor(
**kwargs: object,
):
hf_processor = self.ctx.get_hf_processor()

# NumPy arrays are considered as Iterable but not Sequence in
# https://github.com/huggingface/transformers/blob/main/src/transformers/image_transforms.py#L428
image_processor = hf_processor.image_processor # type: ignore
for attr in ("mean", "std"):
val = getattr(image_processor, attr)
if isinstance(val, np.ndarray):
setattr(image_processor, attr, val.tolist())

return hf_processor

def get_image_processor(self):
Expand Down

0 comments on commit e8616d7

Please sign in to comment.