Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/transformers/core_model_loading.py
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,7 @@ def rename_source_key(
) -> tuple[str, str | None]:
"""
Rename a source key given all the renaming and weight conversion patterns we have. Also takes care of adding/removing
the base model prefix during loading if necesary.
the base model prefix during loading if necessary.
"""
renamed_key = source_key
# 1. apply all renamings in turns (if multiple match, it's the responsibility of the mappings to make sure they
Expand All @@ -870,7 +870,7 @@ def rename_source_key(
if source_pattern is not None:
break

# 3. check if we need to add or remove prefix if necesary (only during loading, not saving)
# 3. check if we need to add or remove prefix if necessary (only during loading, not saving)
if prefix is not None and meta_state_dict is not None:
if (
renamed_key.startswith(prefix)
Expand Down
2 changes: 1 addition & 1 deletion src/transformers/modeling_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2526,7 +2526,7 @@ def tie_weights(self, missing_keys: set[str] | None = None, recompute_mapping: b
# Tie the weights
setattr(parent, name, source_param)
self._adjust_bias(parent, source_param)
# Remove from missing if necesary
# Remove from missing if necessary
if missing_keys is not None and remove_from_missing:
missing_keys.discard(target_param_name)

Expand Down