hiyouga/LlamaFactory · error · ValueError

Video processor was not found, please check and update your

Error message

Video processor was not found, please check and update your model file.

What it means

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.

Source

Thrown at src/llamafactory/data/mm_plugin.py:184

        if len(videos) != 0 and self.video_token is None:
            raise ValueError(
                "This model does not support video input. Please check whether the correct `template` is used."
            )

        if len(audios) != 0 and self.audio_token is None:
            raise ValueError(
                "This model does not support audio input. Please check whether the correct `template` is used."
            )

        if self.image_token is not None and processor is None:
            raise ValueError("Processor was not found, please check and update your model file.")

        if self.image_token is not None and image_processor is None:
            raise ValueError("Image processor was not found, please check and update your model file.")

        if self.video_token is not None and video_processor is None:
            raise ValueError("Video processor was not found, please check and update your model file.")

        if self.audio_token is not None and feature_extractor is None:
            raise ValueError("Audio feature extractor was not found, please check and update your model file.")

    def _validate_messages(
        self,
        messages: list[dict[str, str]],
        images: list["ImageInput"],
        videos: list["VideoInput"],
        audios: list["AudioInput"],
    ):
        r"""Validate if the number of images, videos and audios match the number of placeholders in messages."""
        num_image_tokens, num_video_tokens, num_audio_tokens = 0, 0, 0
        for message in messages:
            num_image_tokens += message["content"].count(IMAGE_PLACEHOLDER)
            num_video_tokens += message["content"].count(VIDEO_PLACEHOLDER)
            num_audio_tokens += message["content"].count(AUDIO_PLACEHOLDER)

View on GitHub (pinned to f28afaf635)

Solutions

  1. Use the official full checkpoint for the video model so its processor config (with video support) is loaded.
  2. Upgrade transformers to the minimum version required by the model family.
  3. Verify in a REPL that AutoProcessor.from_pretrained(path) has video_processor or image_processor set.
  4. If you do not need video, remove video data and switch to an image or text template.

Example fix

# before: processor files from image-only variant
template: qwen2vl

# after: copy processor files from the official video-capable checkpoint and verify
from transformers import AutoProcessor
p = AutoProcessor.from_pretrained(model_path)
assert getattr(p, "video_processor", None) or getattr(p, "image_processor", None)
Defensive patterns

Strategy: validation

Validate before calling

from transformers import AutoProcessor

def has_video_processor(model_path: str) -> bool:
    try:
        p = AutoProcessor.from_pretrained(model_path, trust_remote_code=True)
        return getattr(p, "video_processor", None) is not None or getattr(p, "image_processor", None) is not None
    except Exception:
        return False

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of hiyouga/LlamaFactory@f28afaf635 (2026-08-14). Data as JSON: /api/errors/4929250b787f4886. Report an issue: GitHub.