Skip to content

Commit

Permalink
need to freeze the model (NVIDIA#3540)
Browse files Browse the repository at this point in the history
Signed-off-by: Yi Dong <[email protected]>

Co-authored-by: Eric Harper <[email protected]>
  • Loading branch information
yidong72 and ericharper authored Jan 28, 2022
1 parent 101977e commit 8b2d27a
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ def __init__(self, cfg: DictConfig, trainer: Trainer = None):
trainer=trainer,
)

for param in self.model.parameters():
param.requires_grad = cfg.use_lm_finetune
if not cfg.use_lm_finetune:
self.model.freeze()

hidden_size = self.model.cfg.hidden_size

Expand Down

0 comments on commit 8b2d27a

Please sign in to comment.