Skip to content

Commit

Permalink
correctly handle mt5 (huggingface#9879)
Browse files Browse the repository at this point in the history
  • Loading branch information
stas00 authored and Qbiwan committed Jan 31, 2021
1 parent 8818b6c commit daddaf7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/seq2seq/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ def freeze_embeds(model):
"""Freeze token embeddings and positional embeddings for bart, just token embeddings for t5."""
model_type = model.config.model_type

if model_type == "t5":
if model_type in ["t5", "mt5"]:
freeze_params(model.shared)
for d in [model.encoder, model.decoder]:
freeze_params(d.embed_tokens)
Expand Down

0 comments on commit daddaf7

Please sign in to comment.