Skip to content

Commit b117963

Browse files
committed
small hotfix
- check huggingface#18467
1 parent c9589f6 commit b117963

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/transformers/models/codegen/modeling_codegen.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,7 @@ def _attn(
151151

152152
# compute causal mask from causal mask buffer
153153
query_length, key_length = query.size(-2), key.size(-2)
154-
causal_mask = self.causal_mask[:, :, key_length - query_length : key_length, :key_length]
155-
154+
causal_mask = self.causal_mask[:, :, key_length - query_length : key_length, :key_length].to(torch.uint8)
156155
# Keep the attention weights computation in fp32 to avoid overflow issues
157156
query = query.to(torch.float32)
158157
key = key.to(torch.float32)

0 commit comments

Comments
 (0)