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 vision.py
Daniel Han81984ed2a2db
diff --git a/unsloth/models/vision.py b/unsloth/models/vision.pyindex ad0aeb9915c..16c16296fcb 100644--- a/unsloth/models/vision.py+++ b/unsloth/models/vision.py@@ -392,22 +392,22 @@ class FastBaseModel:tokenizer.pad_token_id = __tokenizer.pad_token_idpass# Fix other stuff like BnB compute data types- model, tokenizer = patch_model_and_tokenizer(- model,- tokenizer,- downcast_rope = False,- fix_embeddings = False,- do_forced_float32 = do_forced_float32,- )- model, tokenizer = patch_tokenizer(model, tokenizer)- model = post_patch_loss_function(model)+ # model, tokenizer = patch_model_and_tokenizer(+ # model,+ # tokenizer,+ # downcast_rope = False,+ # fix_embeddings = False,+ # do_forced_float32 = do_forced_float32,+ # )+ # model, tokenizer = patch_tokenizer(model, tokenizer)+ # model = post_patch_loss_function(model)# Log Unsloth version for future fastpaths for inference- if hasattr(model, "config"):- model.config.update({"unsloth_version" : __version__})- pass- patch_saving_functions(model, vision = True)- patch_saving_functions(tokenizer, vision = True)+ # if hasattr(model, "config"):+ # model.config.update({"unsloth_version" : __version__})+ # pass+ # patch_saving_functions(model, vision = True)+ # patch_saving_functions(tokenizer, vision = True)# Fix gradient accumulationfrom transformers.trainer import Trainer@@ -438,10 +438,10 @@ class FastBaseModel:model.generate = types.MethodType(unsloth_base_fast_generate, model)pass# Post patches- model = FastBaseModel.post_patch_model(- model,- use_gradient_checkpointing = use_gradient_checkpointing,- )+ # model = FastBaseModel.post_patch_model(+ # model,+ # use_gradient_checkpointing = use_gradient_checkpointing,+ # )# Clear deleted GPU itemsfor _ in range(3):gc.collect()