diff --git a/unsloth/models/gemma4_text.py b/unsloth/models/gemma4_text.py index af8bb29346..fd6af0307b 100644 --- a/unsloth/models/gemma4_text.py +++ b/unsloth/models/gemma4_text.py @@ -247,7 +247,7 @@ class ProportionalRoPE(nn.Module): def __call__(self, x: mx.array, offset: int = 0) -> mx.array: # x shape: (B, n_heads, L, head_dim) seq_len = x.shape[-2] - positions = mx.arange(offset, offset + seq_len, dtype = mx.float32) + positions = mx.arange(seq_len, dtype = mx.float32) + offset # (L, head_dim//2) freqs = mx.outer(positions, self._inv_freq)