Skip to content

Commit

Permalink
Add comment explaining the logic behind the if statement
Browse files Browse the repository at this point in the history
  • Loading branch information
mokeddembillel committed Dec 18, 2024
1 parent fc05540 commit b3d022a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions convert_hf_to_gguf.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,7 @@ def get_vocab_base(self) -> tuple[list[str], list[int], str]:
if token in added_vocab:
# We need to manually encode and decode the added tokens in case special characters
# used for `\n` / `\t` have been manually added in the added tokens
# To avoid unexpected issues - we make sure to encode single-char tokens
if len(token) == 1:
token = tokenizer.decode(tokenizer.encode(token, add_special_tokens=False))

Expand Down

0 comments on commit b3d022a

Please sign in to comment.