File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ private class BertEmbedding: Module {
41
41
tokenTypeIds: MLXArray ? = nil
42
42
) -> MLXArray {
43
43
let posIds = positionIds ?? broadcast ( MLXArray . arange ( inputIds. dim ( 1 ) ) , to: inputIds. shape)
44
- let words = wordEmbeddings ( inputIds) + positionEmbeddings( posIds)
44
+ var words = wordEmbeddings ( inputIds) + positionEmbeddings( posIds)
45
45
if let tokenTypeIds, let tokenTypeEmbeddings {
46
46
words += tokenTypeEmbeddings ( tokenTypeIds)
47
47
}
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ class NomicEmbedding: Module {
35
35
_ inputIds: MLXArray , positionIds: MLXArray ? = nil ,
36
36
tokenTypeIds: MLXArray ? = nil
37
37
) -> MLXArray {
38
- let words = wordEmbeddings ( inputIds)
38
+ var words = wordEmbeddings ( inputIds)
39
39
40
40
if let tokenTypeIds, let tokenTypeEmbeddings {
41
41
words += tokenTypeEmbeddings ( tokenTypeIds)
You can’t perform that action at this time.
0 commit comments