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 #156

Open
vincent317 opened this issue Apr 5, 2024 · 1 comment
Open

tokenizer.pad_token #156

vincent317 opened this issue Apr 5, 2024 · 1 comment

Comments

@vincent317
Copy link

Hello team,

When I do:

from transformers import AutoTokenizer
pretrained_model = "EleutherAI/pythia-160m"
tokenizer = AutoTokenizer.from_pretrained(
  pretrained_model,
  padding_side="left",
  cache_dir=pretrained_model+'_tokenizer',
)
print(tokenizer.pad_token)

It seems like the pad_token is empty (None is printed).

tokenizer.pad_token = tokenizer.eos_token seems fixing the issue. Is this the same way to apply padding token as in the training process?

Thank you!

@cauchy221
Copy link

Yes I think so. You can just set the pad_token = eos_token during training.

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

2 participants