Skip to content
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

KeyError in DPO Trainer, evaluation_loop #2473

Open
7 of 9 tasks
qingjianbuyi opened this issue Dec 13, 2024 · 0 comments
Open
7 of 9 tasks

KeyError in DPO Trainer, evaluation_loop #2473

qingjianbuyi opened this issue Dec 13, 2024 · 0 comments
Labels
🐛 bug Something isn't working 🏋 DPO Related to DPO

Comments

@qingjianbuyi
Copy link

qingjianbuyi commented Dec 13, 2024

System Info

  • TRL version: 0.12.1

Information

  • The official example scripts
  • My own modified scripts

Tasks

  • An officially supported task in the examples folder
  • My own task or dataset (give details below)

Reproduction

python examples/scripts/dpo.py \
    --dataset_name trl-lib/ultrafeedback_binarized \
    --model_name_or_path Qwen/Qwen2-0.5B-Instruct \
    --learning_rate 5.0e-6 \
    --num_train_epochs 1 \
    --per_device_train_batch_size 2 \
    --gradient_accumulation_steps 8 \
    --gradient_checkpointing \
    --logging_steps 25 \
    --eval_strategy steps \
    --eval_steps 50 \
    --output_dir Qwen2-0.5B-DPO \
    --no_remove_unused_columns \
    --use_peft \
    --lora_r 32 \
    --lora_alpha 16 \
    --generate_during_eval

Expected behavior

            self.log(
                {
                    "game_log": wandb.Table(
                        columns=["Prompt", "Policy", "Ref Model"],
                        rows=[
                            [prompt, pol[len(prompt) :], ref[len(prompt) :]]
                            for prompt, pol, ref in zip(
#                                random_batch["prompt"], policy_output_decoded, ref_output_decoded
                                self.tokenizer.decode(random_batch["prompt_input_ids"]), policy_output_decoded, ref_output_decoded
                            )
                        ],
                    )
                }
            )

Checklist

  • I have checked that my issue isn't already filed (see open issues)
  • I have included my system information
  • Any code provided is minimal, complete, and reproducible (more on MREs)
  • Any code provided is properly formatted in code blocks, (no screenshot, more on code blocks)
  • Any traceback provided is complete
@qgallouedec qgallouedec added 🐛 bug Something isn't working 🏋 DPO Related to DPO labels Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working 🏋 DPO Related to DPO
Projects
None yet
Development

No branches or pull requests

2 participants