Skip to content

Commit b3d022a

Browse files
Add comment explaining the logic behind the if statement
1 parent fc05540 commit b3d022a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

convert_hf_to_gguf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,7 @@ def get_vocab_base(self) -> tuple[list[str], list[int], str]:
527527
if token in added_vocab:
528528
# We need to manually encode and decode the added tokens in case special characters
529529
# used for `\n` / `\t` have been manually added in the added tokens
530+
# To avoid unexpected issues - we make sure to encode single-char tokens
530531
if len(token) == 1:
531532
token = tokenizer.decode(tokenizer.encode(token, add_special_tokens=False))
532533

0 commit comments

Comments
 (0)