Skip to content

Commit

Permalink
Fix max completion length (#1588)
Browse files Browse the repository at this point in the history
  • Loading branch information
samuki authored May 29, 2024
1 parent 488b502 commit 151a452
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions trl/trainer/kto_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,7 @@ def make_inputs_require_grad(module, input, output):
"truncation_mode": self.truncation_mode,
"label_pad_token_id": self.label_pad_token_id,
"max_prompt_length": self.max_prompt_length,
"max_completion_length": self.max_completion_length,
}
train_dataset = train_dataset.map(
_process_tokens,
Expand Down Expand Up @@ -618,6 +619,7 @@ def make_inputs_require_grad(module, input, output):
"truncation_mode": self.truncation_mode,
"label_pad_token_id": self.label_pad_token_id,
"max_prompt_length": self.max_prompt_length,
"max_completion_length": self.max_completion_length,
}
eval_dataset = eval_dataset.map(
_process_tokens,
Expand Down

0 comments on commit 151a452

Please sign in to comment.