Skip to content
This repository has been archived by the owner on Aug 30, 2024. It is now read-only.

Commit

Permalink
fix glm4 convert error (#295)
Browse files Browse the repository at this point in the history
Signed-off-by: intellinjun <[email protected]>
  • Loading branch information
intellinjun authored Jun 14, 2024
1 parent 7cc2a87 commit 046893c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion neural_speed/convert/convert_chatglm.py
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,8 @@ def chatglm4_convert(model, tokenizer, dir_model, fname_out, ftype, hparams):
fout.write(struct.pack("i", 0)) # n_expert_used
fout.write(struct.pack("i", 0)) # n_embd_head_k for gemma
fout.write(struct.pack("f", hparams.get("layernorm_epsilon", 1e-5))) # rms_norm_eps or layer_norm_eps
fout.write(struct.pack("f", 10000.0)) # freq_base
rope_ratio = hparams.get("rope_ratio", 1)
fout.write(struct.pack("f", rope_ratio*10000.0)) # freq_base
fout.write(struct.pack("f", 1)) # rope_factor

fout.write(struct.pack("f", 0.0)) # config.json "rope_scaling.factor", not enabled
Expand Down

0 comments on commit 046893c

Please sign in to comment.