fix(convert2hf.py): fix the rotary_emb.inv_freq KeyError (#299)

pull/309/head
jiangtann 2023-09-11 20:17:11 +08:00 committed by GitHub
parent e354410bd2
commit 09e71cebf3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -38,7 +38,7 @@ def convert2hf(model_config, states_tp_pps):
current_states["lm_head.weight"] = states.pop("head.weight")
for i in range(model_config["num_layers"]):
states.pop(f"blocks.{i}.mixer.rotary_emb.inv_freq")
states.pop(f"blocks.{i}.mixer.rotary_emb.inv_freq", None)
wqkv = states.pop(f"blocks.{i}.mixer.Wqkv.weight").reshape(
3, model_config["num_attention_heads"], -1, model_config["hidden_size"]