1
0
mirror of https://github.com/huggingface/diffusers.git synced 2026-01-27 17:22:53 +03:00

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.
This commit is contained in:
Pedro Cuenca
2022-11-05 22:17:41 +01:00
committed by GitHub
parent 9d8943b7e7
commit 08a6dc8a58

View File

@@ -88,4 +88,6 @@ class FlaxTimesteps(nn.Module):
@nn.compact
def __call__(self, timesteps):
return get_sinusoidal_embeddings(timesteps, embedding_dim=self.dim, freq_shift=self.freq_shift)
return get_sinusoidal_embeddings(
timesteps, embedding_dim=self.dim, freq_shift=self.freq_shift, flip_sin_to_cos=True
)