task_categories:question-answering task_categories:text-generation language:en license:cc-by-4.0 size_categories:10K<n<100K format:parquet modality:tabular modality:text library:datasets library:pandas library:mlcroissant library:polars region:us
---
license: cc-by-4.0
language:
- en
size_categories:
- 10K<n<100K
task_categories:
- question-answering
- text-generation
---

[nvidia/HelpSteer](https://huggingface.co/datasets/nvidia/HelpSteer) in ChatML format, ready to use in [HuggingFace TRL's SFT Trainer](https://huggingface.co/docs/trl/main/en/sft_trainer).

Python code used for conversion:

```python
from datasets import load_dataset
from transformers import AutoTokenizer

tokenizer = AutoTokenizer.from_pretrained("Felladrin/Llama-160M-Chat-v1")

dataset = load_dataset("nvidia/HelpSteer", split="train")

def format(columns):
    prompt = columns["prompt"].strip()
    response = columns["response"].strip()

    messages = [
        {
            "role": "user",
            "content": prompt,
        },
        {
            "role": "assistant",
            "content": response,
        },
    ]

    return { "text": tokenizer.apply_chat_template(messages, tokenize=False) }

dataset.map(format).select_columns(['text', 'helpfulness', 'correctness', 'coherence', 'complexity', 'verbosity']).to_parquet("train.parquet")
```
