Skip to content

Commit

Permalink
[peft] Given that self.active_adapter is deprecated, avoid using …
Browse files Browse the repository at this point in the history
…it (#34804)

* Given that self.active_adapter is deprecated, avoid using it

* Remove misleading comment - `self.active_adapter` is not used (and deprecated)
  • Loading branch information
tomaarsen authored Nov 25, 2024
1 parent 74db22f commit 11cc229
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/transformers/integrations/peft.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ def enable_adapters(self) -> None:
If you are not familiar with adapters and PEFT methods, we invite you to read more about them on the PEFT
official documentation: https://huggingface.co/docs/peft
Enable adapters that are attached to the model. The model will use `self.active_adapter()`
Enable adapters that are attached to the model.
"""
check_peft_version(min_version=MIN_PEFT_VERSION)

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

if adapter_name is None:
adapter_name = self.active_adapter()
adapter_name = self.active_adapters()[0]

adapter_state_dict = get_peft_model_state_dict(self, adapter_name=adapter_name)
return adapter_state_dict
Expand Down

0 comments on commit 11cc229

Please sign in to comment.