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 active_adapters for transformers models #1975

Conversation

BenjaminBossan
Copy link
Member

Fixes the error reported here:

huggingface/transformers#30790 (comment)

Unfortunately, transformers models have an active_adapters method but it's 1) not a property and 2) calling it fails because the base model (usually) has no loaded adapter. The base model can be a transformers model for prompt learning, where the base model is not wrapped in a LoraModel or similar. Therefore, this special case needs to be handled separately.

Fixes the error reported here:

huggingface/transformers#30790 (comment)

Unfortunately, transformers models have an active_adapters method but
it's 1) not a property and 2) calling it fails because the base
model (usually) has no loaded adapter. The base model can be a
transformers model for prompt learning, where the base model is not
wrapped in a LoraModel or similar. Therefore, this special case needs to
be handled separately.
@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
Member

@sayakpaul sayakpaul left a comment

Choose a reason for hiding this comment

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

Sweet!

@BenjaminBossan BenjaminBossan merged commit f6d3e38 into huggingface:main Jul 30, 2024
14 checks passed
@BenjaminBossan BenjaminBossan deleted the fix-active-adapters-transformers-base-model branch July 30, 2024 13:14
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