Skip to content

Commit 5fe9241

Browse files
pcuencapatrickvonplaten
authored andcommitted
Flax: Flip sin to cos in time embeddings (#1149)
Flip sin to cos in t embeddings. This was assumed in the previous implementation, but now the default is the opposite. Fixes #1145.
1 parent 2ea5eeb commit 5fe9241

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/diffusers/models/embeddings_flax.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,6 @@ class FlaxTimesteps(nn.Module):
8888

8989
@nn.compact
9090
def __call__(self, timesteps):
91-
return get_sinusoidal_embeddings(timesteps, embedding_dim=self.dim, freq_shift=self.freq_shift)
91+
return get_sinusoidal_embeddings(
92+
timesteps, embedding_dim=self.dim, freq_shift=self.freq_shift, flip_sin_to_cos=True
93+
)

0 commit comments

Comments
 (0)