q_len == 1

This commit is contained in:
Daniel Han-Chen 2024-01-23 19:17:42 +11:00
commit d6e85d7731
2 changed files with 1 additions and 2 deletions

View file

@ -232,7 +232,6 @@ def LlamaAttention_fast_forward(
) -> Tuple[torch.Tensor, Optional[torch.Tensor], Optional[Tuple[torch.Tensor]]]:
bsz, q_len, _ = hidden_states.size()
print(hidden_states.size())
# Check for inference
if past_key_value is not None and q_len == 1 and bsz == 1:

View file

@ -49,7 +49,7 @@ def MistralAttention_fast_forward(
bsz, q_len, _ = hidden_states.size()
# Check for inference
if past_key_value is not None and q_len == 1:
if past_key_value is not None and q_len == 1 and bsz == 1:
A, past_key_value = LlamaAttention_fast_forward_inference(
self,
hidden_states,