Skip to content

Commit a03db45

Browse files
committed
Fix: Prioritize default head_dim when provided by architecture (Gemma3) over computed head_dim
1 parent 385a516 commit a03db45

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

exllamav2/config.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,11 @@ def prepare(self, no_tensors: bool = False):
273273
read_config,
274274
int,
275275
"head_dim",
276-
(self.hidden_size // self.num_attention_heads) if self.num_attention_heads else self.arch.lm.default_head_dim,
276+
(
277+
self.arch.lm.default_head_dim if self.arch.lm.default_head_dim != no_default else
278+
(self.hidden_size // self.num_attention_heads) if self.num_attention_heads else
279+
no_default
280+
),
277281
opt_subkey = "text_config"
278282
)
279283

0 commit comments

Comments
 (0)