From db5a9fea4ee166553fa19787ca720150ae833387 Mon Sep 17 00:00:00 2001 From: Andy <40263822+austin2035@users.noreply.github.com> Date: Thu, 15 May 2025 23:08:57 +0800 Subject: [PATCH] Update trainer.py fix lora trainer bug --- trainer.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/trainer.py b/trainer.py index b713d50..6aa3ee2 100644 --- a/trainer.py +++ b/trainer.py @@ -76,6 +76,7 @@ class Pipeline(LightningModule): except ImportError: raise ImportError("Please install peft library to use LoRA training") with open(lora_config_path, encoding="utf-8") as f: + import json lora_config = json.load(f) lora_config = LoraConfig(**lora_config) transformers.add_adapter(adapter_config=lora_config, adapter_name=adapter_name) @@ -825,6 +826,7 @@ def main(args): dataset_path=args.dataset_path, checkpoint_dir=args.checkpoint_dir, adapter_name=args.exp_name, + lora_config_path=args.lora_config_path ) checkpoint_callback = ModelCheckpoint( monitor=None,