File size: 989 Bytes
ff2d42c
 
 
 
 
 
 
 
cf53660
ff2d42c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1bd59db
ff2d42c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
---
license: apache-2.0
language:
- en
size_categories:
- 10K<n<100K
---

[argilla/distilabel-intel-orca-dpo-pairs](https://huggingface.co/datasets/argilla/distilabel-intel-orca-dpo-pairs) in ChatML format, ready to use in [HuggingFace TRL's DPO Trainer](https://huggingface.co/docs/trl/main/en/dpo_trainer).

Python code used for conversion:

```python
from datasets import load_dataset

dataset = load_dataset("argilla/distilabel-intel-orca-dpo-pairs", split="train")

def format(columns):
    prompt = f"<|im_start|>user\n{columns['input']}<|im_end|>\n<|im_start|>assistant\n"

    if (columns['system']):
        prompt = f"<|im_start|>system\n{columns['system']}<|im_end|>\n{prompt}"

    return {
        "prompt": prompt,
        "chosen": f"{columns['chosen']}<|im_end|>",
        "rejected": f"{columns['rejected']}<|im_end|>",
    }

dataset.map(format).select_columns(['prompt', 'chosen', 'rejected', 'status', 'chosen_score', 'in_gsm8k_train']).to_parquet("train.parquet")
```