Update llama.py

This commit is contained in:
Daniel Han-Chen 2024-02-03 23:01:56 +11:00
commit cf0fae9a55

View file

@ -160,7 +160,7 @@ def LlamaAttention_fast_forward_inference(
sin = self.rotary_emb.sin_cached[seq_len]
h = head_dim // 2
RH_Q = self.RH_Q
# RH_Q = self.RH_Q
RH_Q[:,:,:,:h] = Qn[:,:,:,h:]; RH_Q[:,:,:,h:] = Qn[:,:,:,:h]; torch.neg(RH_Q[:,:,:,:h], out = RH_Q[:,:,:,:h]);
Qn *= cos; Qn.addcmul_(RH_Q, sin);