Skip to content

Commit

Permalink
fix #4925
Browse files Browse the repository at this point in the history
  • Loading branch information
hiyouga committed Jul 24, 2024
1 parent 1bbd49f commit 935b22d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/loftq_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def quantize_loftq(
loftq_dir = os.path.join(output_dir, "loftq_init")

# Save LoftQ model
setattr(peft_model.peft_config["default"], "base_model_name_or_path", output_dir)
setattr(peft_model.peft_config["default"], "base_model_name_or_path", os.path.abspath(output_dir))
setattr(peft_model.peft_config["default"], "init_lora_weights", True) # don't apply loftq again
peft_model.save_pretrained(loftq_dir, safe_serialization=save_safetensors)
print("Adapter weights saved in {}".format(loftq_dir))
Expand Down
1 change: 1 addition & 0 deletions scripts/pissa_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ def quantize_pissa(
pissa_dir = os.path.join(output_dir, "pissa_init")

# Save PiSSA model
setattr(peft_model.peft_config["default"], "base_model_name_or_path", os.path.abspath(output_dir))
setattr(peft_model.peft_config["default"], "init_lora_weights", True) # don't apply pissa again
peft_model.save_pretrained(pissa_dir, safe_serialization=save_safetensors)
print("Adapter weights saved in {}".format(pissa_dir))
Expand Down

0 comments on commit 935b22d

Please sign in to comment.