Skip to content

Commit

Permalink
fix: Fix wrong layer norm used in TransformerDecoderLayer (#171)
Browse files Browse the repository at this point in the history
* fix wrong ln used in transformer decoder layer

* run pre-commit
  • Loading branch information
minghuaw authored Dec 4, 2024
1 parent 30eecff commit d5fefbf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Source/MLXNN/Transformer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ class TransformerDecoderLayer: Module {

y = crossAttention(y, keys: memory, values: memory, mask: memoryMask)
y = dropout2(y)
x = ln1(x + y)
x = ln2(x + y)

y = linear1(x)
y = activation(y)
Expand Down

0 comments on commit d5fefbf

Please sign in to comment.