add handling for argilla dpo-mix (#1397)
Browse files
src/axolotl/prompt_strategies/dpo/chatml.py
CHANGED
@@ -24,6 +24,25 @@ def argilla(
|
|
24 |
return transform_fn
|
25 |
|
26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
def icr(
|
28 |
cfg,
|
29 |
**kwargs,
|
|
|
24 |
return transform_fn
|
25 |
|
26 |
|
27 |
+
def argilla_chat(
|
28 |
+
cfg,
|
29 |
+
**kwargs,
|
30 |
+
): # pylint: disable=possibly-unused-variable,unused-argument
|
31 |
+
"""
|
32 |
+
for argilla/dpo-mix-7k conversations
|
33 |
+
"""
|
34 |
+
|
35 |
+
def transform_fn(sample):
|
36 |
+
sample[
|
37 |
+
"prompt"
|
38 |
+
] = f"<|im_start|>user\n{sample['chosen'][0]['content']}<|im_end|>\n<|im_start|>assistant\n"
|
39 |
+
sample["chosen"] = f"{sample['chosen'][1]['content']}<|im_end|>"
|
40 |
+
sample["rejected"] = f"{sample['rejected'][1]['content']}<|im_end|>"
|
41 |
+
return sample
|
42 |
+
|
43 |
+
return transform_fn
|
44 |
+
|
45 |
+
|
46 |
def icr(
|
47 |
cfg,
|
48 |
**kwargs,
|