Skip to content

Commit

Permalink
fix v6 lora (JL-er/RWKV-PEFT@c03cdbb)
Browse files Browse the repository at this point in the history
  • Loading branch information
josStorer committed Mar 14, 2024
1 parent acf5d02 commit c5077f4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions finetune/lora/v6/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,6 @@

from src.model import RWKV, LORA_CONFIG, LoraLinear

model = RWKV(args)

if args.lora:
assert args.lora_r > 0, "LoRA should have its `r` > 0"
LORA_CONFIG["r"] = args.lora_r
Expand All @@ -324,6 +322,9 @@
LORA_CONFIG["parts"] = set(str(args.lora_parts).split(","))
enable_time_finetune = "time" in LORA_CONFIG["parts"]
enable_ln_finetune = "ln" in LORA_CONFIG["parts"]
model = RWKV(args)

if args.lora:
model.requires_grad_(False)
for name, module in model.named_modules():

Expand Down

0 comments on commit c5077f4

Please sign in to comment.