Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
JegernOUTT committed Dec 29, 2023
1 parent 7abe19a commit d4e31d1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion self_hosting_machinery/finetune/modelling/flash_sa.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def _forward(
k = einops.rearrange(k, "b t (h d) -> b h t d", h=self.num_key_value_heads)
v = einops.rearrange(v, "b t (h d) -> b t h d", h=self.num_key_value_heads)

cos, sin = self.rotary_emb(q, seq_len=k.shape[-2])
cos, sin = self.rotary_emb(v, seq_len=k.shape[-2])
q, k = apply_rotary_pos_emb(q, k, cos, sin, position_ids)

q = einops.rearrange(q, "b h t d -> b t h d")
Expand Down
3 changes: 2 additions & 1 deletion self_hosting_machinery/finetune/scripts/aux/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ def forward(
input,
return_dict=False,
output_attentions=False,
output_hidden_states=False
output_hidden_states=False,
use_cache=False
)[0]
return logits

Expand Down

0 comments on commit d4e31d1

Please sign in to comment.