convert : fix rwkv bos/eos token (#13844)

This commit is contained in:
Sigbjørn Skjæret
2025-05-30 14:50:43 +02:00
committed by GitHub
parent 07e4351ce6
commit db38704f01

View File

@ -1047,6 +1047,10 @@ class TextModel(ModelBase):
special_vocab.chat_template = "rwkv-world"
# hack: Add '\n\n' as the EOT token to make it chat normally
special_vocab._set_special_token("eot", 261)
# hack: Override these as they have already been set (incorrectly)
special_vocab.special_token_ids["bos"] = 0
special_vocab.special_token_ids["eos"] = 0
special_vocab.add_to_gguf(self.gguf_writer)
def _set_vocab_builtin(self, model_name: Literal["gpt-neox", "llama-spm"], vocab_size: int):