diff --git a/pyproject.toml b/pyproject.toml index 46c7fc4602..74e1ccc190 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,7 +37,7 @@ triton = [ ] huggingface = [ - "unsloth_zoo>=2025.6.7", + "unsloth_zoo>=2025.6.8", "packaging", "tyro", "transformers>=4.51.3,!=4.47.0,!=4.52.0,!=4.52.1,!=4.52.2,!=4.52.3", @@ -381,7 +381,7 @@ colab-ampere-torch220 = [ "flash-attn>=2.6.3", ] colab-new = [ - "unsloth_zoo>=2025.6.7", + "unsloth_zoo>=2025.6.8", "packaging", "tyro", "transformers>=4.51.3,!=4.47.0,!=4.52.0,!=4.52.1,!=4.52.2,!=4.52.3", diff --git a/unsloth/models/vision.py b/unsloth/models/vision.py index 39ff1fd2bb..53c5497424 100644 --- a/unsloth/models/vision.py +++ b/unsloth/models/vision.py @@ -440,12 +440,12 @@ class FastBaseModel: for jj, (name, module) in enumerate(model.named_modules()): exec(custom_datatype) pass - # Clear deleted GPU items - for _ in range(3): - 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): + gc.collect() + if DEVICE_TYPE == "cuda": torch.cuda.empty_cache() + elif DEVICE_TYPE == "xpu": torch.xpu.empty_cache() pass # Counteract saved tokenizers @@ -562,7 +562,7 @@ class FastBaseModel: finetune_mlp_modules = True, layers_to_transform = None, layers_pattern = None, - use_gradient_checkpointing = True, + use_gradient_checkpointing = "unsloth", random_state = 3407, max_seq_length = 2048, # not used anymore use_rslora = False,