LAION-AI / LAION-AI/Open-Assistant
For peft trainiing how to handle tokenizer changed?
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 37.4k
- Forks
- 3.3k
- PR merge metrics
- No merged PRs in 30d
Description
If the model's num_embeddings is 10000,but we change the tokenizer to 10007.
After SFT training the model's num_embeddings will be 10016, that because in model/model_training/utils/utils.py get_model(conf, tokenizer, pad_vocab_size_to_multiple_of=16, check_freeze_layer=True) has parameter pad_vocab_size_to_multiple_of=16.
But when we try to start a peft training, It will fail because of the following code:
if len(tokenizer) != n_embs and check_freeze_layer:
assert not conf.freeze_layer, "Cannot change the number of embeddings if the model is frozen."
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in model/model_training/utils/utils.py at get_model and inspect how tokenizer length, num_embeddings, pad_vocab_size_to_multiple_of, and check_freeze_layer interact during PEFT training. Reproduce the failure with a tokenizer growing from 10,000 to 10,007 tokens and determine the expected behavior when conf.freeze_layer is enabled; done requires PEFT training to handle this mismatch without the reported assertion failure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100