Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ydshieh committed Dec 15, 2023
1 parent dec51b6 commit 0668589
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/transformers/modeling_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4163,7 +4163,8 @@ def _find_mismatched_keys(

if _fast_init:
mismatched_model_keys = [
checkpoint_key_to_model_key(x[0], remove_prefix_from_model, add_prefix_to_model) for x in mismatched_keys
checkpoint_key_to_model_key(x[0], remove_prefix_from_model, add_prefix_to_model)
for x in mismatched_keys
]
set_initialized_submodules(model, mismatched_model_keys, loaded=False)
# This will only initialize submodules that are re-marked as `not loaded` above due to mismatched
Expand Down

0 comments on commit 0668589

Please sign in to comment.