Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.
Python agentaichatgptdeepseekfine-tuninggemmaimage-generationllamallmllmsopenaipythonqwenreinforcement-learningself-hostedstable-diffusiontext-to-speechttsuiunsloth
Update save.py
Daniel Han7d82555dc8e4
diff --git a/unsloth/save.py b/unsloth/save.pyindex f5ea8d7d8f3..5fa2df7b185 100644--- a/unsloth/save.py+++ b/unsloth/save.py@@ -2745,6 +2745,17 @@ def _unsloth_save_torchao_with_attached_config("""Save a QAT-trained model by converting fake-quantized weights to real quantized weights."""# Convert QAT fake-quantized weights to real quantized weights_convert_torchao_model(model)+ # PEFT models also might come here, so parse it+ if isinstance(model, PeftModelForCausalLM):+ _unsloth_save_torchao_with_given_config(+ model = model,+ save_directory = save_directory,+ tokenizer = tokenizer,+ torchao_config = model.config.quantization_config,+ push_to_hub = push_to_hub,+ token = token,+ )+ return# TorchAO does not support safe_serialization reliablysafe_serialization = False@@ -2897,7 +2908,7 @@ def unsloth_save_pretrained_torchao()if torchao_config is not None:- # PTQ path: user provided a config, model must NOT have QAT config+ # PTQ path: user provided a config, model must NOT have QAT config unless PEFTassert not has_qat_config, ("Unsloth: You passed `torchao_config` but this model was trained with `qat_scheme`. ""For QAT models, do not pass `torchao_config` - the quantization config is already "