huggingface
config_error
ai_generated
true
ValueError: An adapter with the name 'default' is already loaded. Use a unique adapter name or disable this adapter.
ID: huggingface/peft-adapter-name-collision
90%Fix Rate
88%Confidence
1Evidence
2023-10-20First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| peft>=0.6.0 | active | — | — | — |
| transformers>=4.31.0 | active | — | — | — |
| torch>=1.13.0 | active | — | — | — |
Root Cause
PEFT (Parameter-Efficient Fine-Tuning) prevents loading multiple adapters with the same name to avoid weight conflicts. This occurs when calling `load_adapter` twice with the same name or when an adapter named 'default' is already active.
generic中文
PEFT(参数高效微调)阻止加载同名适配器以避免权重冲突。当使用相同名称两次调用 `load_adapter` 或名为 'default' 的适配器已激活时,会发生此错误。
Official Documentation
https://huggingface.co/docs/peft/main/en/developer_guides/multi_adapterWorkarounds
-
95% success Use a unique name for each adapter load, such as including a timestamp or identifier. For example: `model.load_adapter(peft_model_id, adapter_name='my_adapter_v2')`.
Use a unique name for each adapter load, such as including a timestamp or identifier. For example: `model.load_adapter(peft_model_id, adapter_name='my_adapter_v2')`.
-
85% success Disable the current adapter before loading a new one with the same name using `model.disable_adapter()`.
Disable the current adapter before loading a new one with the same name using `model.disable_adapter()`.
中文步骤
Use a unique name for each adapter load, such as including a timestamp or identifier. For example: `model.load_adapter(peft_model_id, adapter_name='my_adapter_v2')`.
Disable the current adapter before loading a new one with the same name using `model.disable_adapter()`.
Dead Ends
Common approaches that don't work:
-
30% fail
Removing the adapter with `delete_adapter('default')` before loading a new one may cause errors if the adapter is currently active and the model has been trained with it.
-
50% fail
Setting `adapter_name=None` in `load_adapter` does not auto-generate a unique name; it defaults to 'default' again.