Skip to content

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.

Update loader.py

Daniel Han8080c4edb0a5
diff --git a/unsloth/models/loader.py b/unsloth/models/loader.py
index 670e0825808..ffc0dc3a5ed 100644
--- a/unsloth/models/loader.py
+++ b/unsloth/models/loader.py
@@ -481,8 +481,8 @@ class FastModel(FastBaseModel):
dtype = torch.float16
assert(dtype in (torch.float16, torch.bfloat16, torch.float32))
- patch_compiled_autograd()
- patch_compiling_bitsandbytes()
+ # patch_compiled_autograd()
+ # patch_compiling_bitsandbytes()
if full_finetuning and (load_in_4bit or load_in_8bit):
print("Unsloth: You selected full finetuning support, but 4bit / 8bit is enabled - disabling LoRA / QLoRA.")
@@ -661,40 +661,40 @@ class FastModel(FastBaseModel):
if use_gradient_checkpointing == "unsloth":
patch_unsloth_smart_gradient_checkpointing(dtype = dtype)
- with redirector:
- patch_loss_functions(torch_compile = False)
- model_types = unsloth_compile_transformers(
- dtype = dtype,
- model_name = model_name,
- model_types = model_types,
- token = token,
- sdpa_dynamic_mask = True,
- sdpa_bool_masks = True,
- sdpa_gqa_replace = True,
- sdpa_dynamic_compile = True,
- compile_attention = True,
- disable_causal_masks = True,
- compile_torch_modules = True,
- compile_custom_modules = True,
- compile_function_calls = True,
- fuse_lm_head = True,
- gradient_checkpointing = True,
- manual_replacements = True,
- fast_lora_forwards = True,
- fast_residual_stream = False,
- accurate_accumulation = True,
- epilogue_fusion = True,
- max_autotune = False,
- shape_padding = True,
- cudagraphs = False,
- debug = False,
- fullgraph = fullgraph,
- import_from_cache = False,
- disable = False,
- return_logits = return_logits,
- trust_remote_code = trust_remote_code,
- )
- pass
+ # with redirector:
+ # patch_loss_functions(torch_compile = False)
+ # model_types = unsloth_compile_transformers(
+ # dtype = dtype,
+ # model_name = model_name,
+ # model_types = model_types,
+ # token = token,
+ # sdpa_dynamic_mask = True,
+ # sdpa_bool_masks = True,
+ # sdpa_gqa_replace = True,
+ # sdpa_dynamic_compile = True,
+ # compile_attention = True,
+ # disable_causal_masks = True,
+ # compile_torch_modules = True,
+ # compile_custom_modules = True,
+ # compile_function_calls = True,
+ # fuse_lm_head = True,
+ # gradient_checkpointing = True,
+ # manual_replacements = True,
+ # fast_lora_forwards = True,
+ # fast_residual_stream = False,
+ # accurate_accumulation = True,
+ # epilogue_fusion = True,
+ # max_autotune = False,
+ # shape_padding = True,
+ # cudagraphs = False,
+ # debug = False,
+ # fullgraph = fullgraph,
+ # import_from_cache = False,
+ # disable = False,
+ # return_logits = return_logits,
+ # trust_remote_code = trust_remote_code,
+ # )
+ # pass
# Check if this is local model since the tokenizer gets overwritten
if os.path.exists(os.path.join(old_model_name, "tokenizer_config.json")) and \