#How to save a full fine tuned model

3 messages Ā· Page 1 of 1 (latest)

half lance
#

Hi, I tried save_pretrained_merged and it said Model is not a PeftModel (no Lora adapters detected). Skipping Merge. Please use save_pretrained() or push_to_hub() instead!

Using save_pretrained seems to work, but the notebook clearly states that "This ONLY saves the LoRA adapters, and not the full model. To save to 16bit or GGUF, scroll down!" for save_pretrained.

Not very sure which one to rely on. Would appreciate clarification. Also, if save_pretrained is the intended method, what precision is the model saved with?

shrewd flickerBOT
#

If you performed full fine-tuning (not LoRA/QLoRA), you should use save_pretrained() to save the entire model. The warning you saw is expected: save_pretrained_merged() is only for merging LoRA adapters into the base model, and will skip merging if no adapters are present. For full fine-tuned models, save_pretrained() saves the complete model weights, not just adapters, and this is the correct method to use according to Unsloth documentation and issues.

The precision of the saved model with save_pretrained() matches the precision used during training and model loading (e.g., float16, bfloat16, or float32). If you loaded or trained the model in float16, it will be saved in float16; if in bfloat16, it will be saved in bfloat16, etc. This is confirmed in Unsloth issues and Unsloth notebooks. Would you like more detail or code examples?

Sources:

half lance
#

Thanks the issue the bot linked makes sense šŸ˜„ šŸ™ , tho perhaps the notebook should be updated then?