hiyouga/LlamaFactory · error · ValueError

This model does not support audio input. Please check whethe

Error message

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

What it means

Third modality guard in BasePlugin._validate_inputs: audios are present in the sample but the plugin's audio_token is None, i.e. the chosen template/plugin does not support audio input. Raised when len(audios) != 0 and self.audio_token is None, before any feature extraction.

Source

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

        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:
            raise ValueError("Audio feature extractor was not found, please check and update your model file.")

    def _validate_messages(
        self,
        messages: list[dict[str, str]],

View on GitHub (pinned to f28afaf635)

Solutions

  1. Use the audio-capable model's official template (e.g. qwen2audio) so the plugin with an audio token is chosen.
  2. Confirm the checkpoint actually contains an audio feature extractor and the matching processor config.
  3. Remove audio fields/placeholders if the run is meant to be text/image-only.
  4. Update LlamaFactory to a release that ships the needed audio plugin.

Example fix

# before (train.yaml for Qwen2-Audio)
template: qwen

# after
template: qwen2audio
Defensive patterns

Strategy: validation

Validate before calling

def template_supports_audio(plugin) -> bool:
    return getattr(plugin, "audio_token", None) is not None

Prevention

When it happens

Trigger: Training on audio-capable data (audios column or <audio> placeholders) with a template mapped to a text- or image-only plugin; selecting a non-audio template for models like Qwen2-Audio.

Common situations: New audio-model support added in newer LlamaFactory versions while the user's template string predates it; reusing vision configs for audio experiments without changing the template.

Related errors


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