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

When training new tokenizer, why vocab size setting doesn't work? #801

Open
fengyunflya opened this issue Feb 27, 2025 · 0 comments
Open

Comments

@fengyunflya
Copy link

follow https://huggingface.co/learn/nlp-course/chapter6/5?fw=pt

I am tring to replicate result using train_new_from_iterator

old_tokenizer = AutoTokenizer.from_pretrained('gpt2')

corpus = [
"This is the Hugging Face Course.",
"This chapter is about tokenization.",
"This section shows several tokenizer algorithms.",
"Hopefully, you will be able to understand how they are trained and generate tokens.",
]

tokenizer = old_tokenizer.train_new_from_iterator(corpus, vocab_size=50)

But the reuslt is totally different, and the tokenizer.vocab_size is 257 which is not 50. Why?

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