Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
348 B
0
Indexable
Never
from peft import LoraConfig, get_peft_model 

config = LoraConfig(
    peft_type='LORA',
    r=8, #attention heads
    lora_alpha=32, #alpha scaling
    target_modules=["query","value"] ,
    lora_dropout=0.01,
    task_type="SEQ_CLS" # set this for Sequence Classification
)

model = get_peft_model(model, config)
print_trainable_parameters(model)
Leave a Comment