|
--- |
|
language: |
|
- en |
|
license: mit |
|
size_categories: |
|
- 100K<n<1M |
|
task_categories: |
|
- text-generation |
|
pretty_name: UltraChat 200k |
|
--- |
|
|
|
[HuggingFaceH4/ultrachat_200k](https://huggingface.co/datasets/HuggingFaceH4/ultrachat_200k) 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("HuggingFaceH4/ultrachat_200k", split="train_sft") |
|
|
|
def format(columns): |
|
return { "text": tokenizer.apply_chat_template(columns["messages"], tokenize=False) } |
|
|
|
dataset.map(format).select_columns(['text', 'prompt', 'prompt_id']).to_parquet("train.parquet") |
|
``` |
|
|