diff --git a/single_shot_inference.py b/single_shot_inference.py index a2bf65ab..6ec85f2c 100644 --- a/single_shot_inference.py +++ b/single_shot_inference.py @@ -136,7 +136,8 @@ class mHCBlock: post_term = post_mix.unsqueeze(-1) * F_out.unsqueeze(1).float() residual_next = mixed_residual + post_term # Emergency: per-residual RMSNorm (routed MoE missing) - rn_f = residual_next.reshape(T, self.n_hc, -1) + _T = residual_next.shape[0] + rn_f = residual_next.reshape(_T, self.n_hc, -1) rms = rn_f.pow(2).mean(-1, keepdim=True).add(1e-6).rsqrt() return (rn_f * rms).bfloat16() # RoPE