Skip to content

Commit cf91f21

Browse files
authored
convert : add pre-computed hashes first to prevent order mishaps (#14701)
1 parent 79e0b68 commit cf91f21

File tree

2 files changed

+31
-31
lines changed

2 files changed

+31
-31
lines changed

convert_hf_to_gguf.py

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -669,6 +669,36 @@ def get_vocab_base_pre(self, tokenizer) -> str:
669669
# NOTE: if you get an error here, you need to update the convert_hf_to_gguf_update.py script
670670
# or pull the latest version of the model from Huggingface
671671
# don't edit the hashes manually!
672+
if chkhsh == "b6e8e1518dc4305be2fe39c313ed643381c4da5db34a98f6a04c093f8afbe99b":
673+
# ref: https://huggingface.co/THUDM/glm-4-9b-chat
674+
res = "chatglm-bpe"
675+
if chkhsh == "81d72c7348a9f0ebe86f23298d37debe0a5e71149e29bd283904c02262b27516":
676+
# ref: https://huggingface.co/THUDM/glm-4-9b-chat
677+
res = "chatglm-bpe"
678+
if chkhsh == "a1336059768a55c99a734006ffb02203cd450fed003e9a71886c88acf24fdbc2":
679+
# ref: https://huggingface.co/THUDM/glm-4-9b-hf
680+
res = "glm4"
681+
if chkhsh == "1431a23e583c97432bc230bff598d103ddb5a1f89960c8f1d1051aaa944d0b35":
682+
# ref: https://huggingface.co/sapienzanlp/Minerva-7B-base-v1.0
683+
res = "minerva-7b"
684+
if chkhsh == "7e57df22b1fe23a7b1e1c7f3dc4e3f96d43a4eb0836d0c6bdc3436d7b2f1c664":
685+
# ref: https://huggingface.co/tencent/Hunyuan-A13B-Instruct
686+
res = "hunyuan"
687+
if chkhsh == "a6b57017d60e6edb4d88ecc2845188e0eb333a70357e45dcc9b53964a73bbae6":
688+
# ref: https://huggingface.co/tiiuae/Falcon-H1-0.5B-Base
689+
res = "falcon-h1"
690+
if chkhsh == "60476e1243776c4fb1b993dbd7a5f15ac22f83c80afdf425fa5ae01c8d44ef86":
691+
# ref: https://huggingface.co/tiiuae/Falcon-H1-1B-Base
692+
res = "falcon-h1"
693+
if chkhsh == "3eda48b4c4dc7de733d1a8b3e3b4a85243dbbf704da2ee9d42c6beced8897896":
694+
# ref: https://huggingface.co/tiiuae/Falcon-H1-7B-Base
695+
res = "falcon-h1"
696+
if chkhsh == "48f8e02c0359c0bbdd82f26909171fac1c18a457bb47573ed1fe3bbb2c1cfd4b":
697+
# ref: https://huggingface.co/tiiuae/Falcon-H1-34B-Base
698+
res = "falcon-h1"
699+
if chkhsh == "81212dc7cdb7e0c1074ca62c5aeab0d43c9f52b8a737be7b12a777c953027890":
700+
# ref: https://huggingface.co/moonshotai/Kimi-K2-Base
701+
res = "kimi-k2"
672702
if chkhsh == "0ef9807a4087ebef797fc749390439009c3b9eda9ad1a097abbe738f486c01e5":
673703
# ref: https://huggingface.co/meta-llama/Meta-Llama-3-8B
674704
res = "llama-bpe"
@@ -804,45 +834,15 @@ def get_vocab_base_pre(self, tokenizer) -> str:
804834
if chkhsh == "d5f1dd6f980fec569fb218a81a7658ac45fc56b38c5a0adeb1c232fbe04ef5ec":
805835
# ref: https://huggingface.co/ByteDance-Seed/Seed-Coder-8B-Base
806836
res = "seed-coder"
807-
if chkhsh == "b6e8e1518dc4305be2fe39c313ed643381c4da5db34a98f6a04c093f8afbe99b":
808-
# ref: https://huggingface.co/THUDM/glm-4-9b-chat
809-
res = "chatglm-bpe"
810-
if chkhsh == "81d72c7348a9f0ebe86f23298d37debe0a5e71149e29bd283904c02262b27516":
811-
# ref: https://huggingface.co/THUDM/glm-4-9b-chat
812-
res = "chatglm-bpe"
813-
if chkhsh == "a1336059768a55c99a734006ffb02203cd450fed003e9a71886c88acf24fdbc2":
814-
# ref: https://huggingface.co/THUDM/glm-4-9b-hf
815-
res = "glm4"
816-
if chkhsh == "1431a23e583c97432bc230bff598d103ddb5a1f89960c8f1d1051aaa944d0b35":
817-
# ref: https://huggingface.co/sapienzanlp/Minerva-7B-base-v1.0
818-
res = "minerva-7b"
819-
if chkhsh == "7e57df22b1fe23a7b1e1c7f3dc4e3f96d43a4eb0836d0c6bdc3436d7b2f1c664":
820-
# ref: https://huggingface.co/tencent/Hunyuan-A13B-Instruct
821-
res = "hunyuan"
822837
if chkhsh == "b0a6b1c0bd5998ebd9df08611efde34a4ff03faed45ae09c43e6b31ebd4b94cf":
823838
# ref: https://huggingface.co/skt/A.X-4.0
824839
res = "a.x-4.0"
825-
if chkhsh == "a6b57017d60e6edb4d88ecc2845188e0eb333a70357e45dcc9b53964a73bbae6":
826-
# ref: https://huggingface.co/tiiuae/Falcon-H1-0.5B-Base
827-
res = "falcon-h1"
828-
if chkhsh == "60476e1243776c4fb1b993dbd7a5f15ac22f83c80afdf425fa5ae01c8d44ef86":
829-
# ref: https://huggingface.co/tiiuae/Falcon-H1-1B-Base
830-
res = "falcon-h1"
831-
if chkhsh == "3eda48b4c4dc7de733d1a8b3e3b4a85243dbbf704da2ee9d42c6beced8897896":
832-
# ref: https://huggingface.co/tiiuae/Falcon-H1-7B-Base
833-
res = "falcon-h1"
834-
if chkhsh == "48f8e02c0359c0bbdd82f26909171fac1c18a457bb47573ed1fe3bbb2c1cfd4b":
835-
# ref: https://huggingface.co/tiiuae/Falcon-H1-34B-Base
836-
res = "falcon-h1"
837840
if chkhsh == "f6791d196f87ce6b56a7d234be618e0d58f8cda3549416635b2bebcd22cd95c4":
838841
# ref: https://huggingface.co/K-intelligence/Midm-2.0-Base-Instruct
839842
res = "midm-2.0"
840843
if chkhsh == "169bf0296a13c4d9b7672313f749eb36501d931022de052aad6e36f2bf34dd51":
841844
# ref: https://huggingface.co/LiquidAI/LFM2-Tokenizer
842845
res = "lfm2"
843-
if chkhsh == "81212dc7cdb7e0c1074ca62c5aeab0d43c9f52b8a737be7b12a777c953027890":
844-
# ref: https://huggingface.co/moonshotai/Kimi-K2-Base
845-
res = "kimi-k2"
846846

847847
if res is None:
848848
logger.warning("\n")

convert_hf_to_gguf_update.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ def get_existing_models(convert_py):
232232
# generate the source code for the convert_hf_to_gguf.py:get_vocab_base_pre() function:
233233

234234
src_ifs = ""
235-
for model in [*all_models, *pre_computed_hashes]:
235+
for model in [*pre_computed_hashes, *all_models]:
236236
name = model["name"]
237237
tokt = model["tokt"]
238238
chkhsh = model.get("chkhsh")

0 commit comments

Comments
 (0)