Skip to content

Commit db38704

Browse files
authored
convert : fix rwkv bos/eos token (#13844)
1 parent 07e4351 commit db38704

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

convert_hf_to_gguf.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,6 +1047,10 @@ def _set_vocab_rwkv_world(self):
10471047
special_vocab.chat_template = "rwkv-world"
10481048
# hack: Add '\n\n' as the EOT token to make it chat normally
10491049
special_vocab._set_special_token("eot", 261)
1050+
# hack: Override these as they have already been set (incorrectly)
1051+
special_vocab.special_token_ids["bos"] = 0
1052+
special_vocab.special_token_ids["eos"] = 0
1053+
10501054
special_vocab.add_to_gguf(self.gguf_writer)
10511055

10521056
def _set_vocab_builtin(self, model_name: Literal["gpt-neox", "llama-spm"], vocab_size: int):

0 commit comments

Comments
 (0)