espnet3.systems.f5tts.src.rotary.RotaryEmbedding
Less than 1 minute
espnet3.systems.f5tts.src.rotary.RotaryEmbedding
class espnet3.systems.f5tts.src.rotary.RotaryEmbedding(dim, use_xpos=False, scale_base=512, interpolation_factor=1.0, base=10000, base_rescale_factor=1.0)
Bases: Module
Rotary positional embedding, the use_xpos=False path only.
Configure the rotation frequencies.
- Parameters:
- dim – Rotary dimension; must be even.
- use_xpos – Kept for signature compatibility. Only
Falseis reproduced here, which is the path F5 exercises. - scale_base – xpos scale base, unused when
use_xposis False. - interpolation_factor – Divides positions to stretch the context.
- base – Frequency base before rescaling.
- base_rescale_factor – NTK-aware rescale;
1.0leavesbaseas is.
forward(t, offset=0)
Return rotation angles for positions t, computed in fp32.
forward_from_seq_len(seq_len)
Return embeddings for positions 0..seq_len - 1.
