Merge pull request #4995 from codemayq/fix-pissa

fix pissa callback
This commit is contained in:
hoshi-hiyouga 2024-07-30 01:47:25 +08:00 committed by GitHub
commit daa62db06f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -165,7 +165,8 @@ class PissaConvertCallback(TrainerCallback):
) )
model.load_adapter(pissa_backup_dir, "default", is_trainable=True) model.load_adapter(pissa_backup_dir, "default", is_trainable=True)
model.set_adapter("default") model.set_adapter("default")
model.delete_adapter("pissa_init") if "pissa_init" in model.peft_config.keys():
model.delete_adapter("pissa_init")
setattr(model.peft_config["default"], "init_lora_weights", init_lora_weights) setattr(model.peft_config["default"], "init_lora_weights", init_lora_weights)