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

[Bug]fix glm4 convert error #295

Merged
merged 1 commit into from
Jun 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading