unsloth
unsloth copied to clipboard
How to merge lora adapter with pretrained weights?
Oh our Colab notebooks on the bottom have this! See https://github.com/unslothai/unsloth/wiki#saving-models-to-16bit-for-vllm
Ie:
model.save_pretrained_merged("model", tokenizer, save_method = "merged_16bit",)
model.push_to_hub_merged("hf/model", tokenizer, save_method = "merged_16bit", token = "")
I have trained an adapter for Qwen2 and pushed it to huggingface hub after using auto train. Now I don’t have access to the virtual machine that created the adapter. But, I have access to the adapter. How do I merge this adapter with the original Qwen2 model?
So sorry on the delay @johnyquest7 - just relocated to SF so the slowness. You can try loading the adapter itself through FastLanguageModel.from_pretrained(adapter)
then doing the saving to 16bit