From b7131a0697071e6e7bad259686acbf1fcb976b6c Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Tue, 11 Mar 2025 15:22:16 -0700 Subject: [PATCH] Update _utils.py --- unsloth/models/_utils.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/unsloth/models/_utils.py b/unsloth/models/_utils.py index 377db89cc0..a21fdd857c 100644 --- a/unsloth/models/_utils.py +++ b/unsloth/models/_utils.py @@ -958,10 +958,10 @@ def _unsloth_get_batch_samples(self, epoch_iterator, num_batches): # Check if model allows **kwargs m = self.model - while hasattr(m, "model"): - # Stop at last model entry - if not hasattr(m, "model") or not hasattr(m, "forward"): break - m = m.model + # while hasattr(m, "model"): + # # Stop at last model entry + # if not hasattr(m, "model") or not hasattr(m, "forward"): break + # m = m.model signature = inspect.signature(m.forward).parameters.values() has_kwargs = tuple(signature)[-1].kind == inspect._VAR_KEYWORD print(m.forward, signature, has_kwargs)