Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions keras_nlp/layers/modeling/transformer_decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,9 +469,11 @@ def _compute_self_attention_mask(
batch_size,
input_length,
output_length,
0
if self_attention_cache_update_index is None
else self_attention_cache_update_index,
(
0
if self_attention_cache_update_index is None
else self_attention_cache_update_index
),
)
return (
ops.minimum(decoder_mask, causal_mask)
Expand Down
8 changes: 5 additions & 3 deletions keras_nlp/models/bloom/bloom_decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,11 @@ def _compute_attention_mask(
batch_size,
input_length,
output_length,
0
if attention_cache_update_index is None
else attention_cache_update_index,
(
0
if attention_cache_update_index is None
else attention_cache_update_index
),
)
return (
ops.minimum(decoder_mask, causal_mask)
Expand Down
8 changes: 5 additions & 3 deletions keras_nlp/models/gpt_neo_x/gpt_neo_x_decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,11 @@ def _compute_self_attention_mask(
batch_size,
input_length,
output_length,
0
if self_attention_cache_update_index is None
else self_attention_cache_update_index,
(
0
if self_attention_cache_update_index is None
else self_attention_cache_update_index
),
)
return (
ops.minimum(decoder_mask, causal_mask)
Expand Down
8 changes: 5 additions & 3 deletions keras_nlp/models/llama/llama_decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,11 @@ def _compute_self_attention_mask(
batch_size,
input_length,
output_length,
0
if self_attention_cache_update_index is None
else self_attention_cache_update_index,
(
0
if self_attention_cache_update_index is None
else self_attention_cache_update_index
),
)
return (
ops.minimum(decoder_mask, causal_mask)
Expand Down