Skip to content

Commit

Permalink
compatibility with older transformers version yl4579#36
Browse files Browse the repository at this point in the history
  • Loading branch information
yl4579 authored Nov 19, 2023
1 parent dbbc7e5 commit 5182a4a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion models.py
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ def load_checkpoint(model, optimizer, path, load_only_params=True, ignore_module
for key in model:
if key in params and key not in ignore_modules:
print('%s loaded' % key)
model[key].load_state_dict(params[key])
model[key].load_state_dict(params[key], strict=False)
_ = [model[key].eval() for key in model]

if not load_only_params:
Expand Down

0 comments on commit 5182a4a

Please sign in to comment.