fix: use peft.utils.other for ModulesToSaveWrapper import

ModulesToSaveWrapper was removed from peft.tuners.tuners_utils in PEFT
0.16.0. The class has been available in peft.utils.other since at least
PEFT 0.7.1, which is the minimum version Unsloth requires.

This fixes the ImportError when using PEFT >= 0.16.0.
This commit is contained in:
danielhanchen 2026-01-09 23:24:39 +00:00
commit 3ffc8b1a5b

View file

@ -146,7 +146,7 @@ torch_nn_functional_softmax = torch.nn.functional.softmax
# SDPA has GQA internally
SDPA_HAS_GQA = "enable_gqa" in scaled_dot_product_attention.__doc__
from peft.tuners.tuners_utils import ModulesToSaveWrapper
from peft.utils.other import ModulesToSaveWrapper
def _offload_frozen_module_for_training(