Fix for non-rotary models without "rotary" in config.json

This commit is contained in:
Gnome Ann
2021-08-20 13:00:53 -04:00
parent 56c9dc2c04
commit 8bfcf86a8b
2 changed files with 3 additions and 3 deletions

View File

@ -378,7 +378,7 @@ def new_forward(
inputs_embeds[:, pos:pos+emb.shape[1]] = emb
offset += emb.shape[1]
if self.rotary:
if hasattr(self, 'rotary') and self.rotary:
hidden_states = inputs_embeds
else:
position_embeds = self.wpe(position_ids)