{"record":{"id":"4929250b787f4886","repo":"hiyouga/LlamaFactory","slug":"video-processor-was-not-found-please-check-and-up","errorCode":null,"errorMessage":"Video processor was not found, please check and update your model file.","messagePattern":"Video 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":184,"sourceCode":"\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.\"\"\"\n        num_image_tokens, num_video_tokens, num_audio_tokens = 0, 0, 0\n        for message in messages:\n            num_image_tokens += message[\"content\"].count(IMAGE_PLACEHOLDER)\n            num_video_tokens += message[\"content\"].count(VIDEO_PLACEHOLDER)\n            num_audio_tokens += message[\"content\"].count(AUDIO_PLACEHOLDER)\n","sourceCodeStart":166,"sourceCodeEnd":202,"githubUrl":"https://github.com/hiyouga/LlamaFactory/blob/f28afaf6355af515454dfb16c97d728307c93897/src/llamafactory/data/mm_plugin.py#L166-L202","documentation":"Video analogue of the image-processor check: the plugin supports video (video_token is not None) but the resolved video_processor (processor.video_processor, falling back to image_processor) is None. The loaded processor cannot preprocess video, so _validate_inputs aborts with an instruction to fix the model files.","triggerScenarios":"A video-capable template with a checkpoint whose processor exposes neither video_processor nor image_processor; older transformers versions where the model's processor class has no video branch; processor files from an image-only variant of the model.","commonSituations":"Fine-tuning Qwen2.5-VL-style models with mismatched processor configs; re-uploaded or merged checkpoints that dropped video processor files; version lag between the model release and the installed transformers.","solutions":["Use the official full checkpoint for the video model so its processor config (with video support) is loaded.","Upgrade transformers to the minimum version required by the model family.","Verify in a REPL that AutoProcessor.from_pretrained(path) has video_processor or image_processor set.","If you do not need video, remove video data and switch to an image or text template."],"exampleFix":"# before: processor files from image-only variant\ntemplate: qwen2vl\n\n# after: copy processor files from the official video-capable checkpoint and verify\nfrom transformers import AutoProcessor\np = AutoProcessor.from_pretrained(model_path)\nassert getattr(p, \"video_processor\", None) or getattr(p, \"image_processor\", None)","handlingStrategy":"validation","validationCode":"from transformers import AutoProcessor\n\ndef has_video_processor(model_path: str) -> bool:\n    try:\n        p = AutoProcessor.from_pretrained(model_path, trust_remote_code=True)\n        return getattr(p, \"video_processor\", None) is not None or getattr(p, \"image_processor\", None) is not None\n    except Exception:\n        return False","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use official video-model checkpoints with their processor configs.","Upgrade transformers alongside new VLM releases.","Dry-run the processor load before multi-GPU training jobs."],"tags":["multimodal","video-processor","model-files","transformers"],"backgroundTag":null,"analyzedSha":"f28afaf6355af515454dfb16c97d728307c93897","analyzedAt":"2026-08-14T21:57:28.298Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}