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 67ba4c5 commit b79c54a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/transformers/modeling_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ def set_initialized_submodules(model, state_dict_keys, loaded=True):
not_loaded_keys = [
k.replace(f"{module_name}.", "") for k in state_dict_keys if k.startswith(f"{module_name}.")
]
if len(set(module.state_dict().keys()).intersection(not_loaded_keys)) > 0:
if set(module.state_dict().keys()) == set(not_loaded_keys):
module._is_hf_initialized = False


Expand Down

0 comments on commit b79c54a

Please sign in to comment.