You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
DPO 不支持 per-pair margin / DPOTrainer does not support per-pair margin in loss #10402
However, DPOTrainer.dpo_loss (dpo_trainer.py:228-363) never reads the margin column. Worse, since concatenated_forward does model(**batch, use_cache=False) without popping margin out of batch first, passing a dataset with a margin field to DPO currently crashes with TypeError: ... unexpected keyword argument 'margin'.
Pull Request / Pull Request 信息
Pull Request / Pull Request 信息
I have already implemented this fix locally and am ready to submit a PR
that links to this issue. See the three changes described above in
`swift/rlhf_trainers/dpo_trainer.py`. I used AI assistance for code
exploration and implementation; I have reviewed every changed line myself.
Activity