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: Implement LoRA on Custom Model with Transformer Encoder #1

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

cosineai[bot]
Copy link

@cosineai cosineai bot commented Oct 25, 2024

This pull request addresses the issue of implementing LoRA on a custom model that includes a transformer encoder from PyTorch. The main challenge was targeting the q, k, and v projection weights in the self-attention block of the transformer encoder layer.

Changes made:

  • Modified the LoRALayer class to inherit from nn.Module, which is necessary for integrating LoRA with PyTorch modules.

This change allows for the correct application of LoRA to the specified projection weights, facilitating the desired functionality in the custom model. This should resolve the issue of not being able to find module names corresponding to the q, k, and v projections in the PyTorch transformer encoder.

MsCosineDemo and others added 4 commits October 25, 2024 15:46
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.

2 participants