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 vision.py

Daniel Han21ec11eaa4be
diff --git a/unsloth/models/vision.py b/unsloth/models/vision.py
index 788df4c74ec..fb0a54489a8 100644
--- a/unsloth/models/vision.py
+++ b/unsloth/models/vision.py
@@ -437,11 +437,6 @@ class FastBaseModel:
if custom_datatype is not None:
for jj, (name, module) in enumerate(model.named_modules()):
exec(custom_datatype)
- if jj % 10 == 0:
- gc.collect()
- if DEVICE_TYPE == "cuda": torch.cuda.empty_cache()
- elif DEVICE_TYPE == "xpu": torch.xpu.empty_cache()
- pass
pass
# Clear deleted GPU items
for _ in range(3):