From b272ea35152f528330b9ef95a8935ef2d110c6df Mon Sep 17 00:00:00 2001 From: turboderp <11859846+turboderp@users.noreply.github.com> Date: Sun, 1 Mar 2026 15:12:33 +0100 Subject: [PATCH] Remove C-style conditionals --- exllamav3/architecture/qwen3_next.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/exllamav3/architecture/qwen3_next.py b/exllamav3/architecture/qwen3_next.py index 8ed90bd..37fbfdf 100644 --- a/exllamav3/architecture/qwen3_next.py +++ b/exllamav3/architecture/qwen3_next.py @@ -62,10 +62,6 @@ class Qwen3NextConfig(Config): self.rope_settings = self.read_rope_settings_default(RopeStyle.NEOX) -def conditional(condition, a, b): - return a if condition else b - - class Qwen3NextModel(Model): config_class = Qwen3NextConfig @@ -97,8 +93,7 @@ class Qwen3NextModel(Model): rms_norm_eps = config.rms_norm_eps, constant_bias = 1.0, ), - attn = conditional( - (idx + 1) % config.full_attention_interval != 0, + attn = ( GatedDeltaNet( config = config, key = f"model.layers.{idx}.linear_attn", @@ -119,7 +114,8 @@ class Qwen3NextModel(Model): key_o = "out_proj", qmap = "block.attn", out_dtype = torch.float, - ), + ) + if (idx + 1) % config.full_attention_interval != 0 else Attention( config = config, key = f"model.layers.{idx}.self_attn",