{"record":{"id":"bcb26a61a572cfb6","repo":"hiyouga/LlamaFactory","slug":"this-model-does-not-support-audio-input-please-ch","errorCode":null,"errorMessage":"This model does not support audio input. Please check whether the correct `template` is used.","messagePattern":"This model does not support audio input\\. Please check whether the correct `template` is used\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/llamafactory/data/mm_plugin.py","lineNumber":173,"sourceCode":"        image_processor: BaseImageProcessor = getattr(processor, \"image_processor\", None)\n        video_processor: BaseImageProcessor = getattr(\n            processor, \"video_processor\", getattr(processor, \"image_processor\", None)\n        )\n        feature_extractor: SequenceFeatureExtractor = getattr(processor, \"feature_extractor\", None) or getattr(\n            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]],","sourceCodeStart":155,"sourceCodeEnd":191,"githubUrl":"https://github.com/hiyouga/LlamaFactory/blob/f28afaf6355af515454dfb16c97d728307c93897/src/llamafactory/data/mm_plugin.py#L155-L191","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Use the audio-capable model's official template (e.g. qwen2audio) so the plugin with an audio token is chosen.","Confirm the checkpoint actually contains an audio feature extractor and the matching processor config.","Remove audio fields/placeholders if the run is meant to be text/image-only.","Update LlamaFactory to a release that ships the needed audio plugin."],"exampleFix":"# before (train.yaml for Qwen2-Audio)\ntemplate: qwen\n\n# after\ntemplate: qwen2audio","handlingStrategy":"validation","validationCode":"def template_supports_audio(plugin) -> bool:\n    return getattr(plugin, \"audio_token\", None) is not None","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Match audio models (Qwen2-Audio) with their audio templates.","Upgrade LlamaFactory when adopting newly supported audio models.","Keep audio fields out of datasets for non-audio stages."],"tags":["multimodal","audio","template","config"],"backgroundTag":null,"analyzedSha":"f28afaf6355af515454dfb16c97d728307c93897","analyzedAt":"2026-08-14T21:57:28.298Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}