Skip to content

Commit 6ba3138

Browse files
authored
Fix ambiguous boolean evaluation in bert.py (#13236)
Signed-off-by: Xue, Zhan <[email protected]>
1 parent 3f6d407 commit 6ba3138

File tree

1 file changed

+1
-1
lines changed
  • python/llm/src/ipex_llm/transformers/models

1 file changed

+1
-1
lines changed

python/llm/src/ipex_llm/transformers/models/bert.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def encoder_forward(
119119
output_hidden_states: Optional[bool] = False,
120120
return_dict: Optional[bool] = True,
121121
):
122-
if attention_mask and not attention_mask.any():
122+
if attention_mask is not None and not attention_mask.any():
123123
attention_mask = None
124124
return BertEncoder.forward(
125125
self=self,

0 commit comments

Comments
 (0)