-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Fix code example in quicktour.md #1181
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
Conversation
|
The documentation is not available anymore as the PR was closed or merged. |
pacman100
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @merveenoyan for fixing the docs! ✨
|
Thanks a lot Merve for fixing this issue, which surely many users stumbled over. Question: Should we fork the repo and move it to https://huggingface.co/peft-internal-testing? Theoretically, that user (or someone else with access to their HF account) could at any point change the checkpoint to be some arbitrary pickle file. |
|
@BenjaminBossan makes sense, or we could have @pacman100's repository adapted to recent changes. However, I'd be in favor of a fork given it's a more recent model. |
|
@BenjaminBossan I duplicated repository under my namespace and changed it in the code as well. |
Thanks @merveenoyan |
* initial file * initial tokenizer * UnpairedPreferenceBatchSampler * use batch_sampler * use interleave_datasets * add loss * fix imports * use SequentialSampler when training * formatting * add other helpers * add prediction_step * fix the kto pair docs * tests * compute_reference_log_probs * add get_eval_dataloader * fix typo * kto with is_encoder_decoder true * Update docs/source/dpo_trainer.mdx Co-authored-by: Younes Belkada <49240599+younesbelkada@users.noreply.github.com> * Update trl/trainer/kto_trainer.py Co-authored-by: Younes Belkada <49240599+younesbelkada@users.noreply.github.com> * Update trl/trainer/kto_trainer.py Co-authored-by: Younes Belkada <49240599+younesbelkada@users.noreply.github.com> * Update trl/trainer/kto_trainer.py Co-authored-by: Younes Belkada <49240599+younesbelkada@users.noreply.github.com> * Update trl/trainer/kto_trainer.py Co-authored-by: Younes Belkada <49240599+younesbelkada@users.noreply.github.com> * Update trl/trainer/kto_trainer.py Co-authored-by: Younes Belkada <49240599+younesbelkada@users.noreply.github.com> * Update trl/trainer/kto_trainer.py Co-authored-by: Younes Belkada <49240599+younesbelkada@users.noreply.github.com> * Update trl/trainer/kto_trainer.py Co-authored-by: Younes Belkada <49240599+younesbelkada@users.noreply.github.com> * Update trl/trainer/kto_trainer.py Co-authored-by: lewtun <lewis.c.tunstall@gmail.com> * Update trl/trainer/kto_trainer.py Co-authored-by: lewtun <lewis.c.tunstall@gmail.com> * Update trl/trainer/kto_trainer.py Co-authored-by: lewtun <lewis.c.tunstall@gmail.com> * fixed typo * Update trl/trainer/kto_trainer.py Co-authored-by: lewtun <lewis.c.tunstall@gmail.com> * Update trl/trainer/kto_trainer.py Co-authored-by: lewtun <lewis.c.tunstall@gmail.com> * Update docs/source/kto_trainer.mdx Co-authored-by: lewtun <lewis.c.tunstall@gmail.com> * Update docs/source/kto_trainer.mdx Co-authored-by: lewtun <lewis.c.tunstall@gmail.com> * renamed KTO dataset keys * use DPOTrainer's get_batch_logps * add get_batch_samples * typo * Handle last token in prompt * Create KTOConfig class that subclasses transformers.TrainingArguments * Update KTO tests to handle KTOConfig * Update KTO script to use KTOConfig * formatting * Update docs/source/dpo_trainer.mdx Co-authored-by: lewtun <lewis.c.tunstall@gmail.com> * Update docs/source/kto_trainer.mdx Co-authored-by: lewtun <lewis.c.tunstall@gmail.com> * Update trl/trainer/kto_trainer.py Co-authored-by: lewtun <lewis.c.tunstall@gmail.com> * Update docs/source/kto_trainer.mdx Co-authored-by: lewtun <lewis.c.tunstall@gmail.com> * Update trl/trainer/training_configs.py Co-authored-by: lewtun <lewis.c.tunstall@gmail.com> * Update examples/scripts/kto.py Co-authored-by: lewtun <lewis.c.tunstall@gmail.com> * Update examples/scripts/kto.py Co-authored-by: lewtun <lewis.c.tunstall@gmail.com> * use max_completion_length * Update examples/scripts/kto.py Co-authored-by: lewtun <lewis.c.tunstall@gmail.com> * add back get_batch_logps * use max_completion_length * move config to its own file * Check tokenize params on Trainer init * Clone labels for end-dec model to solve RuntimeError * formatting * fix enc-dec later * completion_decoder_input_ids is optional for enc-dec * fix breaking test * add a kl key for KL estimation with shuffled completion * add loss ad weights * fix bug in chosen_idx * add back metrics * fix typos * fix kto_loss docs * typo * set loss to None when there is no target completions in batch * use nan tensor instead of none * fix reference_logps test * fix logits * a bit more robust options * log only the correct prompt-completion during eval * Update trl/trainer/kto_trainer.py Co-authored-by: lewtun <lewis.c.tunstall@gmail.com> * Update examples/scripts/kto.py Co-authored-by: lewtun <lewis.c.tunstall@gmail.com> * Update examples/scripts/kto.py Co-authored-by: lewtun <lewis.c.tunstall@gmail.com> * Update docs/source/kto_trainer.mdx Co-authored-by: lewtun <lewis.c.tunstall@gmail.com> * Update docs/source/dpo_trainer.mdx Co-authored-by: lewtun <lewis.c.tunstall@gmail.com> * add docs for desirable_weight and undesirable_weight args * dropout is always disabled * remove DDP hack * formatting * move more arguments of trainer to config * comment out T5 test for now * Add docstring to KTOTrainer * moved Config docstrings to the appropriate class * add autodoc to markdown * formatting * updated copyright year * add model tags * do not add BOS to start of completion * Move data_collator to KTOTrainer * formatting * data_collator is not in args * shuffle_completion with specific input_columns * remove all but the needed columns * Update docs/source/dpo_trainer.mdx Co-authored-by: lewtun <lewis.c.tunstall@gmail.com> * Update examples/scripts/kto.py Co-authored-by: lewtun <lewis.c.tunstall@gmail.com> * Update tests/test_kto_trainer.py Co-authored-by: lewtun <lewis.c.tunstall@gmail.com> * moved more args to kto_config * fjx test * use all_exhausted strategy and shuffle after * use KTOConfig in HfArgumentParser * use ModelConfig --------- Co-authored-by: Younes Belkada <49240599+younesbelkada@users.noreply.github.com> Co-authored-by: lewtun <lewis.c.tunstall@gmail.com> Co-authored-by: Pablo Vicente Juan <p.vicente.juan@gmail.com>
Hello 👋
The model in the code snippet in
quicktour.mdhas a key in it'sconfigfile that's likely either deprecated (breaks backwards compatibility?).The code is as follows 👇
The model's config has
enable_lorakey which raises this error and it fails when initializing theLoraConfigobject. So I changed the code snippet to add a more recent model that doesn't error out (and it's currently trending with good amount of likes too so might be useful).