mirror of
https://github.com/hpcaitech/ColossalAI.git
synced 2025-06-24 14:33:20 +00:00
Merge 3596bd60e7
into 46ed5d856b
This commit is contained in:
commit
c7f9612630
@ -729,6 +729,10 @@ def load_state_dict_into_model(
|
||||
missing_keys = missing_keys.append(sub_missing_keys)
|
||||
|
||||
if strict:
|
||||
if len(error_msgs) > 0:
|
||||
raise RuntimeError(
|
||||
"Error(s) in loading state_dict for {}:\n\t{}".format(model.__class__.__name__, "\n\t".join(error_msgs))
|
||||
)
|
||||
if len(unexpected_keys) > 0:
|
||||
error_msgs = [
|
||||
"Unexpected key(s) in state_dict: {}. ".format(", ".join('"{}"'.format(k) for k in unexpected_keys))
|
||||
|
Loading…
Reference in New Issue
Block a user