Skip to content

Commit

Permalink
modified big_modeling.py (#2376)
Browse files Browse the repository at this point in the history
Co-authored-by: Andrei Panferov <[email protected]>
  • Loading branch information
BlackSamorez and Andrei Panferov authored Jan 25, 2024
1 parent 7644a02 commit e909eb3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/accelerate/big_modeling.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit e909eb3

Please sign in to comment.