Closed leosongwei closed 1 month ago
aha, that's from the save_embedding_layers
:
import peft
peft.utils.other.EMBEDDING_LAYER_NAMES # ['embed_tokens', 'lm_head']
If set:
lora_model.save_pretrained("/dev/shm/lora_save_test", save_embedding_layers=False)
Then the result is small.
System Info
peft==0.12.0 transformers==4.44.2 Python 3.11.2 OS: Debian GNU/Linux 12 (bookworm)
Who can help?
No response
Information
Tasks
examples
folderReproduction
Note that the Qwen2.5-3B has the config
"tie_word_embeddings": true
, I guess that caused the trouble?Result:
Clearly, the base model embedding is saved in the LoRA adaptor.
Expected behavior
No base model parameter should be saved within the LoRA adapter's safetensors file.