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

MNT Make .merged a property #979

Merged

Conversation

BenjaminBossan
Copy link
Member

As discussed internally.

After adding support for multiple active adapters, we have some double bookkeeping when it comes to tracking merged adapters. On the one hand, we have merged_adapters, which lists all merged adapters, and on the other hand, we have the merged attribute, which indicates if at least one adapter is merged.

Having two sources of truth is bad, because it's more work to keep them in sync and there is a risk of them getting out of sync. Therefore, this PR removes the .merged attribute. In order to keep the same interface, we add a .merged property, which returns True if there are any merged_adapters.

This PR also contains some fixes for IA³ from #976 to ensure that tests pass.

Note: This PR should be updated to include LoHa once #956 is merged.

As discussed internally.

After adding support for multiple active adapters, we have some double
bookkeeping when it comes to tracking merged adapters. On the one hand,
we have merged_adapters, which lists all merged adapters, and on the
other hand, we have the merged attribute, which indicates if at least
one adapter is merged.

Having two sources of truth is bad, because it's more work to keep them
in sync and there is a risk of them getting out of sync. Therefore, this
PR removes the .merged attribute. In order to keep the same interface,
we add a merged property, which returns True if there are any
merged_adapters.

This PR also contains some fixes from huggingface#976 to ensure that tests pass.
@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Sep 29, 2023

The documentation is not available anymore as the PR was closed or merged.

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 adding this! Good to merge once the conflicts are resolved.

Copy link
Contributor

@younesbelkada younesbelkada left a comment

Choose a reason for hiding this comment

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

Thanks!

@BenjaminBossan BenjaminBossan merged commit 99f792e into huggingface:main Oct 4, 2023
11 checks passed
@BenjaminBossan BenjaminBossan deleted the make-merged-a-property branch October 4, 2023 09:39
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.

4 participants