Skip to content

Commit 080b549

Browse files
committed
Don't multiply embeddings with embedding_multiplier_scale as it happens in llama.cpp.
1 parent 8a72b3d commit 080b549

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

convert_grok.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -270,13 +270,9 @@ def convert_weight(name, weight, scales, config, dtype=torch.float32, device=Non
270270
else:
271271
weight = weight * scale
272272

273-
if name == "token_embd":
274-
weight *= config.embedding_multiplier_scale
275-
elif len(weight.shape) >= 2:
273+
if name != "token_embd" and len(weight.shape) >= 2:
276274
# Transpose linear matrix
277275
weight = weight.transpose(-1, -2)
278-
279-
280276
if name.endswith("ffn_gate_inp") or name.endswith("_exps"):
281277
weight = weight[config.experts] # gather.
282278

0 commit comments

Comments
 (0)