Skip to content

Commit

Permalink
Do not serialize
Browse files Browse the repository at this point in the history
  • Loading branch information
kwen2501 committed Nov 7, 2024
1 parent 02c8c39 commit 073c521
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/transformers/configuration_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -838,6 +838,9 @@ def to_diff_dict(self) -> Dict[str, Any]:

if "_attn_implementation_internal" in serializable_config_dict:
del serializable_config_dict["_attn_implementation_internal"]
# Do not serialize `base_model_tp_plan` for now
if "base_model_tp_plan" in serializable_config_dict:
del serializable_config_dict["base_model_tp_plan"]

return serializable_config_dict

Expand All @@ -857,6 +860,9 @@ def to_dict(self) -> Dict[str, Any]:
del output["_commit_hash"]
if "_attn_implementation_internal" in output:
del output["_attn_implementation_internal"]
# Do not serialize `base_model_tp_plan` for now
if "base_model_tp_plan" in output:
del output["base_model_tp_plan"]

# Transformers version when serializing the model
output["transformers_version"] = __version__
Expand Down

0 comments on commit 073c521

Please sign in to comment.