Skip to content

Commit 4361735

Browse files
committed
Fix invalid mask implementation
1 parent cab24e9 commit 4361735

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

swift/StableDiffusion/pipeline/TextEncoderT5.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,9 @@ public struct TextEncoderT5: TextEncoderT5Model {
9191

9292
let attentionMaskName = "attention_mask"
9393
var attentionMask: [Int] = inputIds.map { token in
94-
token == padToken ? maskToken : padToken
94+
token == padToken ? padToken : maskToken
9595
}
96-
attentionMask[0] = bosToken
96+
attentionMask[0] = eosToken
9797

9898
let floatIds = inputIds.map { Float32($0) }
9999
let floatMask = attentionMask.map { Float32($0) }

0 commit comments

Comments
 (0)