-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
lora : error message if new token is added in the adapter #9948
Conversation
I think we can support this by loading the full tensor from the LoRA and replacing it in the model, it shouldn't be a problem. Keep a copy to the previous tensor pointer to restore it when unloading the LoRA, and reject applying another LoRA if it also has a full copy of the same tensor. Or better, just modify the LoRA applying functions like |
In fact, I'm thinking of the case where each adapter has its own set of added tokens. This will be impossible because now each adapter has its own definition of the added token. In any cases, I don't think user should add a new tokens to LoRA since the their embeddings will not be trained. In fact, these embeddings will be initialized to random vectors. (I'm merging this PR once @Victoran0 confirms that removing |
Yes @ngxson , removing |
Related to #9778
Explanation from TRL team member:
In llama.cpp, we simply can't support this case because it will break adapter hot-reload (cannot switch
lm_head
orembd_tokens
at runtime). Also, if multiple adapters each has its own set of additional token, we can't mix and match these adapters together.Solution
When fine-tuning your model using TRL, please make sure:
setup_chat_format()