hiyouga/LlamaFactory · error · ValueError

This model does not support video input. Please check whethe

Error message

This model does not support video input. Please check whether the correct `template` is used.

What it means

Counterpart of the image check in BasePlugin._validate_inputs: the sample carries videos, but the selected plugin/template has no video_token, so video input is unsupported for this configuration. Raised before preprocessing, when len(videos) != 0 and self.video_token is None.

Source

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

        images: list["ImageInput"],
        videos: list["VideoInput"],
        audios: list["AudioInput"],
    ) -> None:
        r"""Validate if this model accepts the input modalities."""
        image_processor: BaseImageProcessor = getattr(processor, "image_processor", None)
        video_processor: BaseImageProcessor = getattr(
            processor, "video_processor", getattr(processor, "image_processor", None)
        )
        feature_extractor: SequenceFeatureExtractor = getattr(processor, "feature_extractor", None) or getattr(
            processor, "audio_processor", None
        )
        if len(images) != 0 and self.image_token is None:
            raise ValueError(
                "This model does not support image input. Please check whether the correct `template` is used."
            )

        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:

View on GitHub (pinned to f28afaf635)

Solutions

  1. Switch template to one with video support (e.g. qwen2vl/qwen for Qwen-VL family) matching your model.
  2. Verify the mm_plugin registered for your template in data/template.py handles VIDEO_TOKEN.
  3. If the model is video-incapable, remove videos and <video> placeholders from the dataset.
  4. Upgrade LlamaFactory so newly added video plugins are available.

Example fix

# before (train.yaml for Qwen2.5-VL video data)
template: llama3

# after
template: qwen2vl
Defensive patterns

Strategy: validation

Validate before calling

def template_supports_video(plugin) -> bool:
    return getattr(plugin, "video_token", None) is not None

Prevention

When it happens

Trigger: Using a video dataset (videos column or <video> placeholders) with a template whose mm_plugin lacks video support (many image-only VLM plugins); wrong template string for a video-capable model like Qwen2.5-VL.

Common situations: Assuming image support implies video support; using an older template name that maps to an image-only plugin after a LlamaFactory upgrade reorganized plugin names.

Related errors


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