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

PEFT / Trainer: Make use of model.active_adapters() instead of deprecated model.active_adapter whenever possible #30738

Merged
merged 7 commits into from
May 10, 2024

Conversation

younesbelkada
Copy link
Contributor

@younesbelkada younesbelkada commented May 10, 2024

As per title and as mentioned offline by @BenjaminBossan, model.active_adapter will be deprecated soon, let's make sure to slowly force Trainer to fallback into model.active_adapters instead

cc @BenjaminBossan @amyeroberts

src/transformers/trainer.py Outdated Show resolved Hide resolved
src/transformers/trainer.py Outdated Show resolved Hide resolved
@younesbelkada younesbelkada marked this pull request as ready for review May 10, 2024 09:10
Copy link
Member

@BenjaminBossan BenjaminBossan left a comment

Choose a reason for hiding this comment

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

Thanks for adding this in a backwards compatible way.

Do we plan to one day require a min PEFT version that would make this extra check unnecessary? If yes, we could add a # TODO comment to the code that can be removed.

@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
Collaborator

@amyeroberts amyeroberts left a comment

Choose a reason for hiding this comment

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

Thanks for handling the deprecation!

@younesbelkada younesbelkada merged commit 2d1602a into main May 10, 2024
21 checks passed
@younesbelkada younesbelkada deleted the younesbelkada-fix-deprecated-active-adapter branch May 10, 2024 13:16
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