Skip to content

Commit

Permalink
add handling for argilla dpo-mix (#1397)
Browse files Browse the repository at this point in the history
  • Loading branch information
winglian authored Mar 12, 2024
1 parent 61f83b5 commit adab6c5
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/axolotl/prompt_strategies/dpo/chatml.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,25 @@ def transform_fn(sample):
return transform_fn


def argilla_chat(
cfg,
**kwargs,
): # pylint: disable=possibly-unused-variable,unused-argument
"""
for argilla/dpo-mix-7k conversations
"""

def transform_fn(sample):
sample[
"prompt"
] = f"<|im_start|>user\n{sample['chosen'][0]['content']}<|im_end|>\n<|im_start|>assistant\n"
sample["chosen"] = f"{sample['chosen'][1]['content']}<|im_end|>"
sample["rejected"] = f"{sample['rejected'][1]['content']}<|im_end|>"
return sample

return transform_fn


def icr(
cfg,
**kwargs,
Expand Down

0 comments on commit adab6c5

Please sign in to comment.