Name and Version
version: 8757 (a29e4c0)
built with Clang 19.1.5 for Windows x86_64
Operating systems
Windows, Linux, Mac
Which llama.cpp modules do you know to be affected?
Python/Bash scripts
Command line
python convert_hf_to_gguf.py path/to/model --outfile mmproj.gguf --mmproj --verbose
Problem description & steps to reproduce
The MmprojModel class in convert_hf_to_gguf.py crashes with a KeyError: 'image_mean' when exporting a multimodal projector if the Hugging Face preprocessor_config.json is missing the image_mean or image_std keys. This occurs with several newer Gemma 4 and custom vision checkpoints that don't include these standard preprocessor keys.
The current implementation assumes these keys always exist:
image_mean = _MISTRAL_COMMON_DATASET_MEAN if self.is_mistral_format else self.preprocessor_config["image_mean"]
Relevant log output
Logs
File "convert_hf_to_gguf.py", line 2233, in set_gguf_parameters
image_mean = _MISTRAL_COMMON_DATASET_MEAN if self.is_mistral_format else self.preprocessor_config["image_mean"]
KeyError: 'image_mean'
Name and Version
version: 8757 (a29e4c0)
built with Clang 19.1.5 for Windows x86_64
Operating systems
Windows, Linux, Mac
Which llama.cpp modules do you know to be affected?
Python/Bash scripts
Command line
python convert_hf_to_gguf.py path/to/model --outfile mmproj.gguf --mmproj --verbose
Problem description & steps to reproduce
The
MmprojModelclass inconvert_hf_to_gguf.pycrashes with aKeyError: 'image_mean'when exporting a multimodal projector if the Hugging Facepreprocessor_config.jsonis missing theimage_meanorimage_stdkeys. This occurs with several newer Gemma 4 and custom vision checkpoints that don't include these standard preprocessor keys.The current implementation assumes these keys always exist:
Relevant log output
Logs