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

Using LoRA with CodeGen 2B mono #73

Open
anujsahani01 opened this issue Jul 16, 2023 · 2 comments
Open

Using LoRA with CodeGen 2B mono #73

anujsahani01 opened this issue Jul 16, 2023 · 2 comments

Comments

@anujsahani01
Copy link

anujsahani01 commented Jul 16, 2023

Fine-tuning Salesforce/codegen-2B-mono on my own text to code Python dataset.
I quantized the model using HuggingFace transformer's BitsAndBytesConfig and LoRA config.

Implemented loRA config by using the following code:

from peft import LoraConfig, get_peft_model

lora_config = LoraConfig(
    r=8,
    lora_alpha=32,
    target_modules=[],
    lora_dropout=0.05,
    bias="none",
    task_type="CAUSAL_LM"
)

model = get_peft_model(model, lora_config)

I am not sure what should i be using in target models, in official git provided below.

Target modules for CodeGen is not mentioned.
image

peft git repo

Please help me out with this.
Any of your inputs will be highly appreciated.
Thank You!

@peppa-xyz
Copy link

same issue

@anujsahani01
Copy link
Author

anujsahani01 commented Jul 16, 2023

same issue

Using target_modules= ["q_proj", "v_proj"], as target module worked for me but this is specified for bart model and not for CodeGen.

You may have a look here: https://github.com/huggingface/peft/blob/main/src/peft/utils/other.py#L262

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

No branches or pull requests

2 participants