-
Notifications
You must be signed in to change notification settings - Fork 14
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
LoRA injection utils #3
Conversation
42c3ad4
to
330bf2f
Compare
from invoke_training.lora.lora_block import LoRABlock | ||
|
||
|
||
def find_modules( |
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.
How do you plan on deciding which device to use with torch? In the main app we do a lot of passing around a torch.device object between functions. Could be nice if there's a cleaner way.
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.
Good call out. I hadn't thought about that yet here. As a start, I think I'll update from_layer(...)
to copy the device from the original layer. I can't think of a use case for wanting to override that, but it would be easy enough to add a device
parameter to inject_lora_layers(...)
in the future if we wanted to.
I'll make this change in PR #2
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.
could be a fast follow in a new PR to get everything consolidated into main for now
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.
Addressed in 2225965
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.
lgtm
Add utils and classes to support injecting LoRA layers into existing networks.
main