huggingface config_error ai_generated true

ValueError: The adapter configuration does not match the base model. Expected adapter type 'lora' but got 'ia3'

ID: huggingface/peft-adapter-config-mismatch

Also available as: JSON · Markdown · 中文
88%Fix Rate
85%Confidence
1Evidence
2023-08-10First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
peft>=0.5.0 active
transformers>=4.30.0 active

Root Cause

Loading a PEFT adapter saved with one method (e.g., LoRA) onto a model that expects a different method (e.g., IA3), causing a configuration mismatch.

generic

中文

将一个使用某种方法(例如LoRA)保存的PEFT适配器加载到期望不同方法(例如IA3)的模型上,导致配置不匹配。

Official Documentation

https://huggingface.co/docs/peft/developer_guides/mixed_models

Workarounds

  1. 90% success Load the adapter with the correct PEFT method class explicitly.
    Load the adapter with the correct PEFT method class explicitly.
  2. 85% success Inspect adapter_config.json and set peft_type manually before loading.
    Inspect adapter_config.json and set peft_type manually before loading.
  3. 70% success Re-create the adapter using the correct method from scratch.
    Re-create the adapter using the correct method from scratch.

中文步骤

  1. Load the adapter with the correct PEFT method class explicitly.
  2. Inspect adapter_config.json and set peft_type manually before loading.
  3. Re-create the adapter using the correct method from scratch.

Dead Ends

Common approaches that don't work:

  1. 95% fail

    This flag only handles size mismatches, not adapter type mismatches.

  2. 98% fail

    The issue is not library installation but adapter metadata stored in the adapter_config.json file.