This is the ported version of PKU-Alignment/PKU-SafeRLHF. Below is the code to reproduce.
from datasets import load_dataset
import json
from tqdm import tqdm
def format_conversation(prompt, response):
"""Format prompt and response into conversation structure."""
return [
{'role': 'user', 'content': prompt},
{'role': 'assistant', 'content': response}
]
split = 'test'
ds = load_dataset('PKU-Alignment/PKU-SafeRLHF', 'default', split=split)… See the full description on the dataset page:
https://huggingface.co/datasets/transZ/pku_safe_rlhf.