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 _utils.py
Daniel Han56a4eb4212a2
diff --git a/unsloth/models/_utils.py b/unsloth/models/_utils.pyindex 09bcbda28a7..eb5cc28a2b8 100644--- a/unsloth/models/_utils.py+++ b/unsloth/models/_utils.py@@ -1664,7 +1664,7 @@ passclass TorchAOConfig:qat_scheme : str = "int4"base_config : AOBaseConfig = Int4WeightOnlyConfig- filter_fn : Callable = lambda m, _: isinstance(m, torch.nn.Linear) and m.in_features >= group_size+ filter_fn : Callable = Nonegroup_size : int = 128pass@@ -1694,11 +1694,11 @@ def _prepare_model_for_qat(model: torch.nn.Module, qat_scheme: Union[str, TorchAfilter_fn = lambda m, _: isinstance(m, torch.nn.Linear) and m.in_features >= group_sizeelif qat_scheme == "fp8-fp8":from torchao.quantization import Float8DynamicActivationFloat8WeightConfig- base_config = Float8DynamicActivationFloat8WeightConfig(granularity=PerRow())+ base_config = Float8DynamicActivationFloat8WeightConfig(granularity = PerRow())elif qat_scheme == "int8-int4":from torchao.quantization import Int8DynamicActivationIntxWeightConfiggroup_size = 32- base_config = Int8DynamicActivationIntxWeightConfig(weight_dtype=torch.int4, weight_granularity=PerGroup(group_size))+ base_config = Int8DynamicActivationIntxWeightConfig(weight_dtype = torch.int4, weight_granularity = PerGroup(group_size))filter_fn = lambda m, _: isinstance(m, torch.nn.Linear) and m.in_features >= group_sizeelif qat_scheme == "int4":from torchao.quantization import Int4WeightOnlyConfig