Skip to content

Commit

Permalink
Fix default padding_value in dpo_config.py (huggingface#1692)
Browse files Browse the repository at this point in the history
dpo_config default padding value should be None, not 0, otherwise it by default overrides the padding value of any tokenizer to 0
  • Loading branch information
mnoukhov authored Jun 7, 2024
1 parent 2f71b8b commit 1d84e2b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions trl/trainer/dpo_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class DPOConfig(TrainingArguments):
`"kto_pair"` from the HALOs [report](https://github.com/ContextualAI/HALOs/blob/main/assets/report.pdf), `"bco_pair"` from [BCO](https://arxiv.org/abs/2404.04656) paper or `"robust"` from [Robust DPO](https://arxiv.org/abs/2403.00409) paper.
label_pad_token_id (`int`, defaults to `-100`):
The label pad token id. This argument is required if you want to use the default data collator.
padding_value (`int`, defaults to `0`):
padding_value (`Optional[int]`, *optional*):
The padding value if it is different to the tokenizer's pad_token_id.
truncation_mode (`str`, defaults to `keep_end`):
The truncation mode to use, either `keep_end` or `keep_start`. This argument is required if you want to use the default data collator.
Expand Down Expand Up @@ -81,7 +81,7 @@ class DPOConfig(TrainingArguments):
"sigmoid", "hinge", "ipo", "kto_pair", "bco_pair", "sppo_hard", "nca_pair", "robust"
] = "sigmoid"
label_pad_token_id: int = -100
padding_value: int = 0
padding_value: Optional[int] = None
truncation_mode: str = "keep_end"
max_length: Optional[int] = None
max_prompt_length: Optional[int] = None
Expand Down

0 comments on commit 1d84e2b

Please sign in to comment.