From 0ca1be00977439795b6bdb448fbd8f257f363b6a Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Mon, 30 Jun 2025 07:07:38 -0700 Subject: [PATCH] Update vision.py --- unsloth/models/vision.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/unsloth/models/vision.py b/unsloth/models/vision.py index 788df4c74e..fb0a54489a 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):