Skip to content

Commit

Permalink
Update convert_hf_to_gguf.py
Browse files Browse the repository at this point in the history
Co-authored-by: compilade <[email protected]>
  • Loading branch information
MollySophia and compilade authored Aug 12, 2024
1 parent 786152a commit e6f08bc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions convert_hf_to_gguf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2728,8 +2728,8 @@ def set_vocab(self):
toktypes.append(gguf.TokenType.NORMAL)
remainder = vocab_size - len(tokens)
assert remainder >= 0
for i in range(remainder):
tokens.append(f"<unused {i}>".encode("utf-8"))
for i in range(len(tokens), vocab_size):
tokens.append(f"[PAD{i}]".encode("utf-8"))
toktypes.append(gguf.TokenType.UNUSED)

self.gguf_writer.add_tokenizer_model("rwkv")
Expand Down

0 comments on commit e6f08bc

Please sign in to comment.