Skip to content

Commit

Permalink
Fix init
Browse files Browse the repository at this point in the history
  • Loading branch information
carmocca committed May 23, 2024
1 parent 2174054 commit d882a8f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion litgpt/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -514,5 +514,7 @@ def instantiate_torch_optimizer(optimizer, model_parameters, **kwargs):
optimizer_cls = getattr(torch.optim, optimizer)
optimizer = optimizer_cls(model_parameters, **kwargs)
else:
optimizer = instantiate_class(model_parameters, optimizer, **kwargs)
optimizer = dict(optimizer) # copy
optimizer["init_args"].update(kwargs)
optimizer = instantiate_class(model_parameters, optimizer)
return optimizer

0 comments on commit d882a8f

Please sign in to comment.