Skip to content

Commit

Permalink
adding groupnorm
Browse files Browse the repository at this point in the history
Co-authored-by: Minho Ryu <ryumin93@gmail.com>
  • Loading branch information
weak-kajuma and bzantium authored Oct 20, 2024
1 parent 63b018a commit 204bec8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/transformers/models/diffllama/modeling_diffllama.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ def __init__(self, config: DiffLlamaConfig, layer_idx: Optional[int] = None):
self.lambda_k1 = nn.Parameter(torch.normal(0, 0.1, size=(self.head_dim,)))
self.lambda_q2 = nn.Parameter(torch.normal(0, 0.1, size=(self.head_dim,)))
self.lambda_k2 = nn.Parameter(torch.normal(0, 0.1, size=(self.head_dim,)))
self.groupnorm = nn.RMSNorm(self.hidden_size, eps=config.rms_norm_eps, elementwise_affine=False)

# TODO (joao): remove in v4.46 (RoPE is computed in the model, not in the decoder layers)
self.rotary_emb = DiffLlamaRotaryEmbedding(config=self.config)
Expand Down

0 comments on commit 204bec8

Please sign in to comment.