Skip to content
Snippets Groups Projects
Commit 91afa917 authored by duzx16's avatar duzx16
Browse files

Add no share embeddings for T5

parent 407a44a5
No related branches found
No related tags found
No related merge requests found
......@@ -177,6 +177,10 @@ class T5DecoderFinalMixin(BaseMixin):
def __init__(self, vocab_size, hidden_size, tie_word_embeddings=True):
super().__init__()
self.hidden_size = hidden_size
self.tie_word_embeddings = tie_word_embeddings
if not tie_word_embeddings:
self.lm_head = VocabParallelEmbedding(
vocab_size, hidden_size, init_method=unscaled_init_method(0.02))
def final_forward(self, logits, **kwargs):
logits_parallel = copy_to_model_parallel_region(logits)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment