Skip to content

Commit

Permalink
Change RotaryEmbedding to GPTNeoXRotaryEmbedding (togethercomputer#168)
Browse files Browse the repository at this point in the history
updates GPTNeoX RotaryEmbedding for transformeres==4.31.0
  • Loading branch information
azahed98 authored Aug 17, 2023
1 parent 759fc49 commit 6372379
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions training/modules/hf_gptneox_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from transformers.models.gpt_neox.modeling_gpt_neox import GPTNeoXLayer as _GPTNeoXBlock
from transformers.models.gpt_neox.modeling_gpt_neox import GPTNeoXModel as _GPTNeoXModel
from transformers.models.gpt_neox.configuration_gpt_neox import GPTNeoXConfig as GPTConfig
from transformers.models.gpt_neox.modeling_gpt_neox import RotaryEmbedding
from transformers.models.gpt_neox.modeling_gpt_neox import GPTNeoXRotaryEmbedding


try:
Expand Down Expand Up @@ -111,7 +111,7 @@ def __init__(self, config):
),
)
self.register_buffer("masked_bias", torch.tensor(-1e9))
self.rotary_emb = RotaryEmbedding(
self.rotary_emb = GPTNeoXRotaryEmbedding(
self.rotary_ndims, config.max_position_embeddings, base=config.rotary_emb_base
)
self.register_buffer(
Expand Down

0 comments on commit 6372379

Please sign in to comment.