Unverified Commit ac43a40e authored by Stas Bekman's avatar Stas Bekman Committed by GitHub
Browse files

[modeling_utils] better explanation of ignore keys (#16741)

parent 0235bc57
...@@ -704,14 +704,15 @@ class PreTrainedModel(nn.Module, ModuleUtilsMixin, GenerationMixin, PushToHubMix ...@@ -704,14 +704,15 @@ class PreTrainedModel(nn.Module, ModuleUtilsMixin, GenerationMixin, PushToHubMix
main_input_name = "input_ids" main_input_name = "input_ids"
_auto_class = None _auto_class = None
# a list of re pattern of tensor names to ignore from the model when loading the model weights # a list of `re` patterns of `state_dict` keys that should be removed from the list of missing
# (and avoid unnecessary warnings). # keys we find (keys inside the model but not in the checkpoint) and avoid unnecessary warnings.
_keys_to_ignore_on_load_missing = None _keys_to_ignore_on_load_missing = None
# a list of re pattern of tensor names to ignore from the weights when loading the model weights # a list of `re` patterns of `state_dict` keys that should be removed from the list of
# (and avoid unnecessary warnings). # unexpected keys we find (keys inside the checkpoint but not the model) and avoid unnecessary
# warnings.
_keys_to_ignore_on_load_unexpected = None _keys_to_ignore_on_load_unexpected = None
# a list of of tensor names to ignore when saving the model (useful for keys that aren't # a list of `state_dict` keys to ignore when saving the model (useful for keys that aren't
# trained, but which are deterministic, or tied variables) # trained, but which are either deterministic or tied variables)
_keys_to_ignore_on_save = None _keys_to_ignore_on_save = None
is_parallelizable = False is_parallelizable = False
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment