Skip to content

Commit

Permalink
Fix invalid mask implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
KyuHwan00 committed Sep 23, 2024
1 parent cab24e9 commit 4361735
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions swift/StableDiffusion/pipeline/TextEncoderT5.swift
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ public struct TextEncoderT5: TextEncoderT5Model {

let attentionMaskName = "attention_mask"
var attentionMask: [Int] = inputIds.map { token in
token == padToken ? maskToken : padToken
token == padToken ? padToken : maskToken
}
attentionMask[0] = bosToken
attentionMask[0] = eosToken

let floatIds = inputIds.map { Float32($0) }
let floatMask = attentionMask.map { Float32($0) }
Expand Down

0 comments on commit 4361735

Please sign in to comment.