Update convert-llama-h5-to-gguf.py

This commit is contained in:
klosax 2023-07-30 17:29:56 +02:00 committed by GitHub
parent 30c4ea47e6
commit 068a8e0fbe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -64,8 +64,8 @@ gguf_writer = gguf.GGUFWriter.open(fname_out)
with open(dir_model + "/config.json", "r", encoding="utf-8") as f:
hparams = json.load(f)
# This mmust be changed when adding/deleting kv
kv_count = 14
# This must be changed when adding/deleting kv
kv_count = 13
print("tensors " + str(tensor_count) + " kv " + str(kv_count))
@ -86,7 +86,6 @@ gguf_writer.write_layer_count(llm_arch, hparams["num_hidden_layers"])
gguf_writer.write_feed_forward_length(llm_arch, hparams["intermediate_size"])
gguf_writer.write_rope_dimension_count(llm_arch, hparams["hidden_size"] // hparams["num_attention_heads"])
gguf_writer.write_head_count(llm_arch, hparams["num_attention_heads"])
gguf_writer.write_float32(llm_arch + ".attention.layer_norm_rms_epsilon", hparams["rms_norm_eps"])
gguf_writer.write_layer_norm_rms_eps(llm_arch, hparams["rms_norm_eps"])