Skip to content

Commit

Permalink
Training PEFT models with new tokens being added to the embedding lay…
Browse files Browse the repository at this point in the history
…ers and tokenizer (#1147)

* add support for saving base layers weights along with adapter weights

* Update save_and_load.py

* Add an example showing the usage of the added feature

* refactor the functionality

* fix

* refactoring code

1. Add `is_embedding_layer_resized` parameter to `save_pretrained`
2. Fix the deduplication in README when adding PEFT details.
3. `save_pretrained` should only save the model when `is_main_process=True` which is one of the parameters of `save_pretrained`.

* update example

* fix the model card

* fix model card

* 😅

* fix model card

* automate setting `is_embedding_layer_resized`

* nits

* Update peft_lora_clm_with_additional_tokens.ipynb

* add test

* fix tests

* maybe fixes the issue?

* address comments

Co-Authored-By: Benjamin Bossan <BenjaminBossan@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Benjamin Bossan <BenjaminBossan@users.noreply.github.com>

---------

Co-authored-by: Benjamin Bossan <BenjaminBossan@users.noreply.github.com>
  • Loading branch information
pacman100 and BenjaminBossan authored Nov 29, 2023
1 parent f0fb951 commit 8298f1a
Show file tree
Hide file tree
Showing 5 changed files with 1,167 additions and 19 deletions.
Loading

0 comments on commit 8298f1a

Please sign in to comment.