Downloads · 30 days
0
pierretokns/LFM2-VL-1.6B-bf16-preprocessor-fix
LFM2-VL-1.6B-bf16-preprocessor-fix is a machine learning model from pierretokns. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This repo contains a corrected preprocessorconfig.json for mlx-community/LFM2-VL-1.6B-bf16.
Downloads · 30 days
0
Access
Public
Updated Feb 2, 2026
Repo size
—
Likes
0
Public
Click a slice to open those files.
.md1.7 KB · 46%
From the Hugging Face model README
This repo contains a corrected preprocessor_config.json for mlx-community/LFM2-VL-1.6B-bf16.
The mlx-community conversion of LFM2-VL-1.6B has two bugs in preprocessor_config.json:
image_processor_type is set to "Siglip2ImageProcessor" instead of "Lfm2VlImageProcessorFast"input_data_format is set to "channels_last" instead of nullThese cause inference to crash with:
RuntimeError: The size of tensor a (H) must match the size of tensor b (3) at non-singleton dimension 1
The error occurs because input_data_format: "channels_last" tells the image processor the input is already in (H, W, C) format, but torchvision's normalize expects (C, H, W). When set to null, the processor auto-detects the format correctly.
Compare with the original LiquidAI/LFM2-VL-1.6B preprocessor_config.json:
| Field | mlx-community (broken) | LiquidAI (correct) | This fix |
|---|---|---|---|
image_processor_type | Siglip2ImageProcessor | Lfm2VlImageProcessorFast | Lfm2VlImageProcessorFast |
input_data_format | "channels_last" | null | null |
To use this fix, either:
from mlx_vlm import load
model, processor = load("mlx-community/LFM2-VL-1.6B-bf16")
processor.image_processor.input_data_format = None
This should be fixed in the mlx-community conversion. Filed as a reference for anyone hitting this error.