From 541ef37c6444c087bfc72c3991691ea167720840 Mon Sep 17 00:00:00 2001 From: 51616 Date: Tue, 7 Jan 2025 16:57:37 +0000 Subject: [PATCH] no_grad for ctx_encoder model --- hyperlora/modeling_utils.py | 1 + 1 file changed, 1 insertion(+) diff --git a/hyperlora/modeling_utils.py b/hyperlora/modeling_utils.py index 30a1e69..92a8cca 100644 --- a/hyperlora/modeling_utils.py +++ b/hyperlora/modeling_utils.py @@ -321,6 +321,7 @@ class EarlyExit(nn.Module): self.base_model = base_model self.exit_layer = exit_layer + @torch.no_grad() def forward(self, **kwargs): # if len(kwargs["input_ids"].shape) == 1: # kwargs["input_ids"] = kwargs["input_ids"].unsqueeze(0)