Skip to content

Commit

Permalink
chore: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
winglian committed May 9, 2024
1 parent 94ea13a commit 3c4c680
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/axolotl/prompt_strategies/dpo/llama3.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ def transform_fn(sample):
"prompt"
] = f"<|begin_of_text|><|start_header_id|>user<|end_header_id|>\n\n{sample['chosen'][0]['content']}<|eot_id|><|start_header_id|>assistant<|end_header_id|>\n\n"
sample["chosen"] = f"{sample['chosen'][1]['content']}<|eot_id|><|end_of_text|>"
sample["rejected"] = f"{sample['rejected'][1]['content']}<|eot_id|><|end_of_text|>"
sample[
"rejected"
] = f"{sample['rejected'][1]['content']}<|eot_id|><|end_of_text|>"
return sample

return transform_fn
Expand Down Expand Up @@ -127,7 +129,9 @@ def transform_fn(sample):
"prompt"
] = f"<|begin_of_text|><|start_header_id|>user<|end_header_id|>\n\n{sample['prompt']}<|eot_id|><|start_header_id|>assistant<|end_header_id|>\n\n"
sample["chosen"] = f"{sample['chosen'][1]['content']}<|eot_id|><|end_of_text|>"
sample["rejected"] = f"{sample['rejected'][1]['content']}<|eot_id|><|end_of_text|>"
sample[
"rejected"
] = f"{sample['rejected'][1]['content']}<|eot_id|><|end_of_text|>"
return sample

return transform_fn

0 comments on commit 3c4c680

Please sign in to comment.