diff --git a/src/ggml.c b/src/ggml.c index c76d00a39..d2d98da39 100644 --- a/src/ggml.c +++ b/src/ggml.c @@ -13929,7 +13929,7 @@ static void rope_yarn( float theta_interp = freq_scale * theta_extrap; float theta = theta_interp; if (ext_factor != 0.0f) { - float ramp_mix = rope_yarn_ramp(corr_dims[0], corr_dims[1], i0) * ext_factor; + float ramp_mix = rope_yarn_ramp(corr_dims[0] - 1, corr_dims[1], i0) * ext_factor; theta = theta_interp * (1 - ramp_mix) + theta_extrap * ramp_mix; // Get n-d magnitude scaling corrected for interpolation