Repository navigation
Export the trained weights when a full fine-tune loaded from a local folder is saved to GGUF - #11601
Conversation
…folder is saved to GGUF
|
Confirmed that on main a full fine-tune loaded from a local folder is converted from the original checkpoint in save.py, so the GGUF has the untrained weights and that folder's tokenizer files are overwritten. Will get this reviewed. |
Reproduction and fix evidenceHead: GitHub Actions A/B. Same workflow and probe on both branches; only
Real GGUF export on GPU (L4, unsloth 2026.9.9, transformers 5.17.0, torch 2.8.0). SmolLM2-135M-Instruct is loaded from a local folder with
Caller-supplied
The disk preflight now sizes the supplied Qwen3.5-2B VLM (L40S): loaded from a local folder with Studio: export loads checkpoints without Tests: 520 passed across the GGUF/saving suites. The two failures, |
…odel The fast encoder path builds the SentenceTransformer directly and never went through FastModel, so the inner model handed to the GGUF saver carried no full-finetuning mark and a full fine-tune loaded from a local folder was converted from that folder's untrained weights.
|
Pushed three small commits on top of the fix:
Not changed on purpose: a non-PEFT model trained without |
|
Staging check for head
|
Lyxot
left a comment
There was a problem hiding this comment.
LGTM. The fix routes every non-PEFT GGUF decision through one checkpoint-reuse check, Codex found no issues, and CI passed on this head in staging.
…folder is saved to GGUF (unslothai#11601) * Export the trained weights when a full fine-tune loaded from a local folder is saved to GGUF * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Forward state_dict when a full fine-tune is saved directly for GGUF * Convert the supplied state_dict instead of reusing the loaded checkpoint for GGUF * Size the supplied state_dict in the GGUF disk preflight * Update GGUF routing docstrings * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * docs(save): tighten GGUF checkpoint-reuse docstrings * test(save): cover state_dict forwarding through the GGUF disk preflight * fix(sentence_transformer): mark full finetuning on the fast encoder model The fast encoder path builds the SentenceTransformer directly and never went through FastModel, so the inner model handed to the GGUF saver carried no full-finetuning mark and a full fine-tune loaded from a local folder was converted from that folder's untrained weights. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Lyxot <[email protected]>
After full fine-tuning a model loaded from a folder on disk, save_pretrained_gguf builds the GGUF from that original folder. The file has the untrained weights, and the tokenizer files in your folder get rewritten.
When the model was loaded for full fine-tuning, the trained weights are now saved to the output folder and converted from there. Studio export still reuses the checkpoint as before.