From e909eb34e26dcf372dd0a38b975026b45eb87da6 Mon Sep 17 00:00:00 2001 From: Andrei Panferov Date: Thu, 25 Jan 2024 16:16:52 +0300 Subject: [PATCH] modified big_modeling.py (#2376) Co-authored-by: Andrei Panferov --- src/accelerate/big_modeling.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/accelerate/big_modeling.py b/src/accelerate/big_modeling.py index b217feedc23..4e6ab7ef8ec 100644 --- a/src/accelerate/big_modeling.py +++ b/src/accelerate/big_modeling.py @@ -124,6 +124,7 @@ def register_empty_parameter(module, name, param): if param is not None: param_cls = type(module._parameters[name]) kwargs = module._parameters[name].__dict__ + kwargs["requires_grad"] = param.requires_grad module._parameters[name] = param_cls(module._parameters[name].to(device), **kwargs) def register_empty_buffer(module, name, buffer, persistent=True):