Skip to content

Commit 11cc229

Browse files
authored
[peft] Given that self.active_adapter is deprecated, avoid using it (#34804)
* Given that self.active_adapter is deprecated, avoid using it * Remove misleading comment - `self.active_adapter` is not used (and deprecated)
1 parent 74db22f commit 11cc229

File tree

1 file changed

+2
-2
lines changed
  • src/transformers/integrations

1 file changed

+2
-2
lines changed

src/transformers/integrations/peft.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ def enable_adapters(self) -> None:
381381
If you are not familiar with adapters and PEFT methods, we invite you to read more about them on the PEFT
382382
official documentation: https://huggingface.co/docs/peft
383383
384-
Enable adapters that are attached to the model. The model will use `self.active_adapter()`
384+
Enable adapters that are attached to the model.
385385
"""
386386
check_peft_version(min_version=MIN_PEFT_VERSION)
387387

@@ -457,7 +457,7 @@ def get_adapter_state_dict(self, adapter_name: Optional[str] = None) -> dict:
457457
from peft import get_peft_model_state_dict
458458

459459
if adapter_name is None:
460-
adapter_name = self.active_adapter()
460+
adapter_name = self.active_adapters()[0]
461461

462462
adapter_state_dict = get_peft_model_state_dict(self, adapter_name=adapter_name)
463463
return adapter_state_dict

0 commit comments

Comments
 (0)