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 the requires_grad adjustment logic in mark_only_lora_as_trainable #125

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MikuAndRabbit
Copy link

Added code to the mark_only_lora_as_trainable method to set requires_grad to True for parameters with lora_ in the name.

This change was made for the following reason.

Sometimes requires_grad may be set to False for all parameters of the whole model before calling the mark_only_lora_as_trainable method, and if following the logic of the existing mark_only_lora_as_trainable method, the requires_grad of the parameter whose name contains lora_ is still set to False after calling, which I think has some conflict with the method name mark_only_lora_as_trainable.

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.

1 participant