diff options
author | Fizz~ <168598314+fizzAI@users.noreply.github.com> | 2025-07-06 06:13:55 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-07-06 12:13:55 +0200 |
commit | 6f3a3ba7e249cd689cb1ab0376e6504fb6cd49e7 (patch) | |
tree | bda7a12deedd88dca2e11e0a696d203bc625663e /convert_hf_to_gguf.py | |
parent | 22f67917f63bd222b73a4581e9892d2b2a427bde (diff) |
Special handling of Seed Coder FIM tokens (#585)
* Special handling of Seed Coder FIM tokens
* vocab: Add Seed Coder pretokenizer
* Formatting fix
* Update llama.h
Diffstat (limited to 'convert_hf_to_gguf.py')
-rw-r--r-- | convert_hf_to_gguf.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/convert_hf_to_gguf.py b/convert_hf_to_gguf.py index 1754e486..33be63fa 100644 --- a/convert_hf_to_gguf.py +++ b/convert_hf_to_gguf.py @@ -636,6 +636,9 @@ class Model: if chkhsh == "877081d19cf6996e2c4ff0e1236341e9b7bde288f5311a56a937f0afbbb3aeb5": # ref: https://huggingface.co/deepseek-ai/DeepSeek-V3 res = "deepseek-v3" + if chkhsh == "d5f1dd6f980fec569fb218a81a7658ac45fc56b38c5a0adeb1c232fbe04ef5ec": + # ref: https://huggingface.co/ByteDance-Seed/Seed-Coder-8B-Base + res = "seed-coder" if res is None: logger.warning("\n") @@ -1520,6 +1523,17 @@ class LlamaModel(Model): special_vocab._set_special_token("eot", 32010) special_vocab.add_to_gguf(self.gguf_writer) + # Apply to Seed-Coder only (and ignore otherwise) + if self.hparams.get("vocab_size", 32000) == 155136: + special_vocab = gguf.SpecialVocab( + self.dir_model, load_merges=False, + special_token_types = ['prefix', 'suffix', 'middle', 'eot'] + ) + special_vocab._set_special_token("prefix", 124) + special_vocab._set_special_token("suffix", 125) + special_vocab._set_special_token("middle", 126) + special_vocab.add_to_gguf(self.gguf_writer) + def set_gguf_parameters(self): super().set_gguf_parameters() hparams = self.hparams |