Skip to content

Commit

Permalink
fix dpo bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
mst272 committed Aug 18, 2024
1 parent 8b709b0 commit d05ecaa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main_train.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ def load_dpo_dataset(args, tokenizer):

def process(row):
row["prompt"] = tokenizer.apply_chat_template(row["chosen"][:-1], tokenize=False)
row["chosen"] = tokenizer.apply_chat_template(row["chosen"][-1], tokenize=False)
row["rejected"] = tokenizer.apply_chat_template(row["rejected"][-1], tokenize=False)
row["chosen"] = tokenizer.apply_chat_template([row["chosen"][-1]], tokenize=False)
row["rejected"] = tokenizer.apply_chat_template([row["rejected"][-1]], tokenize=False)
return row

train_dataset = train_dataset.map(process)
Expand Down

0 comments on commit d05ecaa

Please sign in to comment.