Skip to content

Commit 1fa7518

Browse files
authored
fix rwkv bos/eos token
1 parent 1e8659e commit 1fa7518

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
@@ -1044,6 +1044,10 @@ def _set_vocab_rwkv_world(self):
10441044
special_vocab.chat_template = "rwkv-world"
10451045
# hack: Add '\n\n' as the EOT token to make it chat normally
10461046
special_vocab._set_special_token("eot", 261)
1047+
# hack: Override these as they have already been set (incorrectly)
1048+
special_vocab.special_token_ids["bos"] = 0
1049+
special_vocab.special_token_ids["eos"] = 0
1050+
10471051
special_vocab.add_to_gguf(self.gguf_writer)
10481052

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

0 commit comments

Comments
 (0)