Skip to content

Commit

Permalink
🆚 Distinguish padding and eos when they differ (#2793)
Browse files Browse the repository at this point in the history
  • Loading branch information
binary-husky authored Feb 7, 2025
1 parent cf97133 commit 2241f17
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion trl/scripts/sft.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ def main(script_args, training_args, model_args):
tokenizer = AutoTokenizer.from_pretrained(
model_args.model_name_or_path, trust_remote_code=model_args.trust_remote_code, use_fast=True
)
tokenizer.pad_token = tokenizer.eos_token
if tokenizer.pad_token is None:
tokenizer.pad_token = tokenizer.eos_token

################
# Dataset
Expand Down

0 comments on commit 2241f17

Please sign in to comment.