rope-flax

Rotary Position Embedding for Flax

APACHE-2.0 License

Stars
4

Rotary Position Embedding for Flax.

Implements the position embeddings from RoFormer: Enhanced Transformer with Rotary Position Embedding for Flax. rotary-embedding-torch was used as a reference implementation.

Features:

  • 1D (for sequence models) and 2D axial (for ViT) rotary embeddings.
  • Learnable frequencies, including separate learnable frequencies per attention head.

Usage

Coming soon

Related Projects