Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: Bug with handling of active adapters #1659

Conversation

BenjaminBossan
Copy link
Member

There was a bug for some models like IA3, LoHa, etc., where calling set_adapter would not correctly update the active_adapter. This is now fixed.

Note that this is not about the active_adapter attribute on PeftModel or layers, which are handled separately.

This PR also ensures that LoraModel, IA3Model, etc. consistently use self.active_adapters, not self.active_adapter. The latter should be treated more like a private attribute (but this isn't changed for backwards compatibility).

There was a bug for some models like IA3, LoHa, etc., where calling
set_adapter would not correctly update the active_adapter. This is now
fixed.

Note that this is not about the active_adapter attribute on PeftModel or
layers, which are handled separately.

This PR also ensures that LoraModel, IA3Model, etc. consistently use
self.active_adapters, not self.active_adapter. The latter should be
treated more like a private attribute (but this isn't changed for
backwards compatibility).
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Copy link
Contributor

@pacman100 pacman100 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @BenjaminBossan for the fixes wrt properly setting adapters and updating the active adapters!

@BenjaminBossan BenjaminBossan merged commit ed865e2 into huggingface:main Apr 17, 2024
14 checks passed
@BenjaminBossan BenjaminBossan deleted the fix-bug-active-adapter-handling branch April 17, 2024 11:39
BenjaminBossan added a commit to BenjaminBossan/peft that referenced this pull request Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants