-
Notifications
You must be signed in to change notification settings - Fork 283
fix get_lora_target_names function #2167
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 get_lora_target_names function #2167
Conversation
keras_hub/src/models/backbone.py
Outdated
@@ -202,7 +204,7 @@ def enable_lora(self, rank, target_names=None): | |||
of the attention layers. | |||
""" | |||
if target_names is None: | |||
target_names = self.get_lora_target_names() | |||
target_names = self.get_lora_target_names(target_names=None) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
get_lora_target_names()
won't still work correctly in the following code and will return the default values:
model.enable_lora(rank=2, target_names=["query"])
model.get_lora_target_names()
I don't think we should expect the user to pass the target names to get the target names. If they already know what the target names are, they won't have to call get_lora_target_names()
.
Maybe it'd be good to define a new member variable like lora_target_names
and define setter/getter for it and initialize it with default values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, Divya! Left some nit comments!
@divyashreepathihalli are you still working on this? |
This PR is stale because it has been open for 14 days with no activity. It will be closed if no further activity occurs. Thank you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
No description provided.