Skip to content

Commit

Permalink
feat(transformers): weight convert on model prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
wcrzlh committed Feb 20, 2025
1 parent e77def0 commit 26354b4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mindone/transformers/modeling_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ def _load_state_dict_into_model(model_to_load, state_dict, start_prefix, prefix,
local_state = {k: v for k, v in model_to_load.parameters_and_names()}
for k, v in state_dict.items():
prefix_k = prefix + "." + k
wo_prefix_k = k[len(prefix)+1:]
wo_prefix_k = k[len(prefix) + 1 :]
if k in local_state:
v.set_dtype(local_state[k].dtype)
elif wo_prefix_k in local_state:
Expand Down

0 comments on commit 26354b4

Please sign in to comment.