{"record":{"id":"fd356c1ef2dc3253","repo":"hiyouga/LlamaFactory","slug":"processor-was-not-found-please-check-and-update-y","errorCode":null,"errorMessage":"Processor was not found, please check and update your model file.","messagePattern":"Processor was not found, please check and update your model file\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/llamafactory/data/mm_plugin.py","lineNumber":178,"sourceCode":"            processor, \"audio_processor\", None\n        )\n        if len(images) != 0 and self.image_token is None:\n            raise ValueError(\n                \"This model does not support image input. Please check whether the correct `template` is used.\"\n            )\n\n        if len(videos) != 0 and self.video_token is None:\n            raise ValueError(\n                \"This model does not support video input. Please check whether the correct `template` is used.\"\n            )\n\n        if len(audios) != 0 and self.audio_token is None:\n            raise ValueError(\n                \"This model does not support audio input. Please check whether the correct `template` is used.\"\n            )\n\n        if self.image_token is not None and processor is None:\n            raise ValueError(\"Processor was not found, please check and update your model file.\")\n\n        if self.image_token is not None and image_processor is None:\n            raise ValueError(\"Image processor was not found, please check and update your model file.\")\n\n        if self.video_token is not None and video_processor is None:\n            raise ValueError(\"Video processor was not found, please check and update your model file.\")\n\n        if self.audio_token is not None and feature_extractor is None:\n            raise ValueError(\"Audio feature extractor was not found, please check and update your model file.\")\n\n    def _validate_messages(\n        self,\n        messages: list[dict[str, str]],\n        images: list[\"ImageInput\"],\n        videos: list[\"VideoInput\"],\n        audios: list[\"AudioInput\"],\n    ):\n        r\"\"\"Validate if the number of images, videos and audios match the number of placeholders in messages.\"\"\"","sourceCodeStart":160,"sourceCodeEnd":196,"githubUrl":"https://github.com/hiyouga/LlamaFactory/blob/f28afaf6355af515454dfb16c97d728307c93897/src/llamafactory/data/mm_plugin.py#L160-L196","documentation":"ValueError from BasePlugin._validate_inputs: the template's plugin expects image input (image_token is not None) but `processor` passed to the data pipeline is None — no ProcessorMixin was found for the model. LlamaFactory locates the processor via AutoProcessor/processor files in the model repo; absence means the model files are incomplete or the wrong checkpoint is used.","triggerScenarios":"Loading a vision-language template with a model path that lacks preprocessor_config.json/processor files (e.g. only the LM backbone was uploaded, or a LoRA adapter directory is used as model_name_or_path); checkpoint downloads interrupted so processor files are missing.","commonSituations":"Users pointing model_name_or_path at a text-only base model while the template is multimodal; manually pruned repos; adapters saved without the base processor; partial downloads from hf_hub.","solutions":["Point model_name_or_path at the complete multimodal checkpoint that includes processor files (preprocessor_config.json etc.).","Re-download the model to repair missing files (delete and refetch the snapshot, or use hf download).","If combining an adapter with a base model, keep the multimodal base in model_name_or_path and pass the adapter via adapter_name_or_path.","If the run is text-only, switch template to a text-only one so no processor is required."],"exampleFix":"# before\nmodel_name_or_path: /models/qwen2vl-lora-adapter  # adapter dir lacks processor\ntemplate: qwen2vl\n\n# after\nmodel_name_or_path: Qwen/Qwen2-VL-7B-Instruct\nadapter_name_or_path: /models/qwen2vl-lora-adapter\ntemplate: qwen2vl","handlingStrategy":"validation","validationCode":"from transformers import AutoProcessor\n\ndef model_has_processor(model_path: str) -> bool:\n    try:\n        return AutoProcessor.from_pretrained(model_path, trust_remote_code=True) is not None\n    except Exception:\n        return False","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run get_template_and_fix_tokenizer/AutoProcessor in a dry-run script before launching long jobs.","Keep full multimodal checkpoints intact; pass adapters via adapter_name_or_path.","Verify downloads completed (snapshot file counts) after network errors."],"tags":["multimodal","processor","model-files","config"],"backgroundTag":null,"analyzedSha":"f28afaf6355af515454dfb16c97d728307c93897","analyzedAt":"2026-08-14T21:57:28.298Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}