Skip to content

Conversation

aniruddh10124
Copy link

Allows functionality for finetuning the model using LoRA. To make use of the changes, need to only add extrac flags while running the training script. The flags would be the following:
-- use_lora True --lora_rank 8 --lora_alpha 16 --lora_dropout 0.05 --lora_target_modules q_proj k_proj v_proj out_proj fc1 fc2 --lora_weights_path

It is the base file which implements the LoRA Linear Layer and implements useful methods for working with a model on which LoRA has been applied. Furthermore, implements a function which can convert any model into one with LoRA if the names of the affected linear layers of the model are known
Added arguments for a flag for applying lora and added functionality to change the parameters used in lora like rank, alpha, dropout probability, target module names (the module names which will be changed to lora linear from linear) and lora weights path (the path to the lora weights)
Changed the training script to allow LoRA implementation. Three main areas of changes
* Imported apply_lora_to_model
* Applied the above function to the model if the user_lora flag is True
* Saved the LoRA weights at the checkpoints when the other model weights are being saved
Edited training script so that LoRA can be applied to the model
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