8000 convert : fix handling of added tokens by cebtenzzre · Pull Request #3405 · ggml-org/llama.cpp · GitHub
[go: up one dir, main page]

Skip to content

convert : fix handling of added tokens #3405

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
s/else if/elif/
  • Loading branch information
cebtenzzre committed Oct 1, 2023
commit f18cfeab62ca426be5d73cdf8547d8cd48bd9cde
2 changes: 1 addition & 1 deletion convert-falcon-hf-to-gguf.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def parse_args() -> argparse.Namespace:
print(f"Key {i} not in tokenizer vocabulary. Padding with an arbitrary token.")
pad_token = f"[PAD{i}]".encode("utf8")
text = bytearray(pad_token)
else if i in added_tokens:
elif i in added_tokens:
# these tokens are not encoded, see https://github.com/huggingface/transformers/issues/1133
text = bytearray(reverse_vocab[i].encode('utf-8'))
else:
Expand Down
2 changes: 1 addition & 1 deletion convert-gptneox-hf-to-gguf.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def parse_args() -> argparse.Namespace:
print(f"Key {i} not in tokenizer vocabulary. Padding with an arbitrary token.")
pad_token = f"[PAD{i}]".encode("utf8")
text = bytearray(pad_token)
else if i in added_tokens:
elif i in added_tokens:
# these tokens are not encoded, see https://github.com/huggingface/transformers/issues/1133
text = bytearray(reverse_vocab[i].encode('utf-8'))
else:
Expand Down
2 changes: 1 addition & 1 deletion convert-starcoder-hf-to-gguf.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def parse_args() -> argparse.Namespace:
print(f"Key {i} not in tokenizer vocabulary. Padding with an arbitrary token.")
pad_token = f"[PAD{i}]".encode("utf8")
text = bytearray(pad_token)
else if i in added_tokens:
elif i in added_tokens:
# these tokens are not encoded, see https://github.com/huggingface/transformers/issues/1133
text = bytearray(reverse_vocab[i].encode('utf-8'))
else:
Expand Down
0