Update modeling_quiet.py
Browse files- modeling_quiet.py +1 -1
modeling_quiet.py
CHANGED
@@ -1046,7 +1046,7 @@ class QuietModel(QuietPreTrainedModel):
|
|
1046 |
inputs_embeds = self.embed_tokens(input_ids)
|
1047 |
|
1048 |
if attention_mask is not None and self._attn_implementation == "flash_attention_2" and use_cache:
|
1049 |
-
is_padding_right = attention_mask[:, -1].
|
1050 |
if is_padding_right:
|
1051 |
raise ValueError(
|
1052 |
"You are attempting to perform batched generation with padding_side='right'"
|
|
|
1046 |
inputs_embeds = self.embed_tokens(input_ids)
|
1047 |
|
1048 |
if attention_mask is not None and self._attn_implementation == "flash_attention_2" and use_cache:
|
1049 |
+
is_padding_right = (attention_mask[:, -1] == 0).any().item()
|
1050 |
if is_padding_right:
|
1051 |
raise ValueError(
|
1052 |
"You are attempting to perform batched generation with padding_side='right'"
|