-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Adding new vocab doesn't saved the model #773
Comments
@wukaixingxp @mreso can you please take a look? |
@andymvp2018 Can you show me the complete log of how you train the model, how you convert the FSDP to HF model? What command did you use? |
For the training, I just use that https://github.com/meta-llama/llama-recipes/blob/main/src/llama_recipes/finetuning.py#L188. For converting FSDP to HF:
|
I think the problem is probability due to https://github.com/meta-llama/llama-recipes/blob/main/src/llama_recipes/tools/convert_hf_weights_to_llama.py#L45, here, we should also change the dimensionality of the model (i.e, adding new tokens and then resize) |
System Info
8 gpu on A100
Information
🐛 Describe the bug
on the finetuning.py script, and did
https://github.com/meta-llama/llama-recipes/blob/main/src/llama_recipes/finetuning.py#L188
tokenizer.add(['wreqw', 'ewqr', 'weqrqewrqw',...])
model.resize_token_embeddings(len(tokenizer))
But then after saving the model when it finish training, I convert it from FSDP into huggingface checkpoint, , and see that the
model.get_input_embeddings().weight.shape[0]
is still pre-added tokenizer dimension, which means that the newly added model embeddings isn't being saved.Error logs
N/A
Expected behavior
The model should have a larger embeddings dimension
The text was updated successfully, but these errors were encountered: