Skip to content
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

tokenizer.pad_token_id and tokenizer.bos_token_id are both equal to 1 (openllmplayground/openalpaca_7b_700bt_preview)openalpaca_7b_700bt_preview) #9

Open
moruga123 opened this issue Jul 17, 2023 · 0 comments

Comments

@moruga123
Copy link

from transformers import LlamaTokenizer
model_path = r'openllmplayground/openalpaca_7b_700bt_preview'
tokenizer = LlamaTokenizer.from_pretrained(model_path)
print(f"tokenizer.bos_token_id = {tokenizer.bos_token_id}")
print(f"tokenizer.eos_token_id = {tokenizer.eos_token_id}")
print(f"tokenizer.pad_token_id = {tokenizer.pad_token_id}")

Output:
tokenizer.bos_token_id = 1
tokenizer.eos_token_id = 2
tokenizer.pad_token_id = 2

Is this a problem?

I saw someone's code making this modification to the tokenizer, but I don't know why it would be recommended:

tokenizer.pad_token_id = (
0 # unk. we want this to be different from the eos token
)
tokenizer.padding_side = "left"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant