fix #4925
This commit is contained in:
parent
1bbd49faae
commit
935b22d93e
|
@ -67,7 +67,7 @@ def quantize_loftq(
|
||||||
loftq_dir = os.path.join(output_dir, "loftq_init")
|
loftq_dir = os.path.join(output_dir, "loftq_init")
|
||||||
|
|
||||||
# Save LoftQ model
|
# 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
|
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)
|
peft_model.save_pretrained(loftq_dir, safe_serialization=save_safetensors)
|
||||||
print("Adapter weights saved in {}".format(loftq_dir))
|
print("Adapter weights saved in {}".format(loftq_dir))
|
||||||
|
|
|
@ -62,6 +62,7 @@ def quantize_pissa(
|
||||||
pissa_dir = os.path.join(output_dir, "pissa_init")
|
pissa_dir = os.path.join(output_dir, "pissa_init")
|
||||||
|
|
||||||
# Save PiSSA model
|
# 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
|
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)
|
peft_model.save_pretrained(pissa_dir, safe_serialization=save_safetensors)
|
||||||
print("Adapter weights saved in {}".format(pissa_dir))
|
print("Adapter weights saved in {}".format(pissa_dir))
|
||||||
|
|
Loading…
Reference in New Issue