Skip to content

Commit

Permalink
Add TODO to clean this up a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
Rocketknight1 committed Dec 7, 2023
1 parent c217246 commit 0c5c883
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/transformers/modeling_tf_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2893,6 +2893,9 @@ def from_pretrained(
model = cls(config, *model_args, **model_kwargs)

if tf_to_pt_weight_rename is None and hasattr(model, "tf_to_pt_weight_rename"):
# TODO Matt: This is a temporary workaround to allow weight renaming, but requires a method
# to be defined for each class that requires a rename. We can probably just have a class-level
# dict and a single top-level method or something and cut down a lot of boilerplate code
tf_to_pt_weight_rename = model.tf_to_pt_weight_rename

if from_pt:
Expand Down

0 comments on commit 0c5c883

Please sign in to comment.