{"record":{"id":"dc82288fd53870cc","repo":"hiyouga/LlamaFactory","slug":"audio-feature-extractor-was-not-found-please-chec","errorCode":null,"errorMessage":"Audio feature extractor was not found, please check and update your model file.","messagePattern":"Audio feature extractor 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":187,"sourceCode":"                \"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\n        if len(images) != num_image_tokens:\n            raise ValueError(\n                f\"The number of images does not match the number of {IMAGE_PLACEHOLDER} tokens in {messages}.\"","sourceCodeStart":169,"sourceCodeEnd":205,"githubUrl":"https://github.com/hiyouga/LlamaFactory/blob/f28afaf6355af515454dfb16c97d728307c93897/src/llamafactory/data/mm_plugin.py#L169-L205","documentation":"Audio analogue in _validate_inputs: the plugin has an audio_token but no feature_extractor can be resolved (neither processor.feature_extractor nor processor.audio_processor). Without a SequenceFeatureExtractor the audio samples cannot be prepared, so the error asks you to check/update the model files.","triggerScenarios":"Audio-capable template paired with a checkpoint whose processor lacks feature_extractor/audio_processor attributes; wrong processor class auto-resolved due to missing or outdated processor_config.json; transformers too old for the audio model.","commonSituations":"Text checkpoints used with audio templates; re-uploads missing feature_extractor_config.json; custom processor classes behind trust_remote_code whose installed version differs.","solutions":["Load the complete official audio-capable checkpoint so its feature extractor config ships along.","Upgrade transformers/LlamaFactory to versions supporting the audio model's processor.","Check AutoProcessor.from_pretrained(path).feature_extractor is not None before launching training.","Pass trust_remote_code: true if the checkpoint uses a custom processor class."],"exampleFix":"# before\nmodel_name_or_path: /models/qwen2-text-only\ntemplate: qwen2audio\n\n# after\nmodel_name_or_path: Qwen/Qwen2-Audio-7B-Instruct\ntemplate: qwen2audio\ntrust_remote_code: true","handlingStrategy":"validation","validationCode":"from transformers import AutoProcessor\n\ndef has_feature_extractor(model_path: str) -> bool:\n    try:\n        p = AutoProcessor.from_pretrained(model_path, trust_remote_code=True)\n        return getattr(p, \"feature_extractor\", None) is not None or getattr(p, \"audio_processor\", None) is not None\n    except Exception:\n        return False","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Ship audio checkpoints with feature_extractor_config.json intact.","Set trust_remote_code: true for custom-processor models.","Validate processor attributes in CI for containerized training images."],"tags":["multimodal","audio","feature-extractor","model-files"],"backgroundTag":null,"analyzedSha":"f28afaf6355af515454dfb16c97d728307c93897","analyzedAt":"2026-08-14T21:57:28.298Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}