#3835·peft

delete_adapter 会跳过那些模块名包含调谐器前缀 (例如 lora_foobar) 的适配器层

作者: JoeyTan21创建于 2026年9月28日更新于 2026年9月29日

So after `delete_adapter("other")`, the `lora_foobar` layer keeps the weights of the deleted adapter (they are also still in `state_dict()`), and because `other` was the active adapter, that layer keeps applying it in `forward`, while `lin0` uses `default`. This is the inconsistent state that the docstring of `BaseTunerLayer.delete_adapter` warns about.

内容来源: huggingface/peft