File size: 337 Bytes
729b0f4
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import random

from datasets import Dataset


class JailBreakExampleRepo:
    _dataset: list[dict[str, str]]

    def __init__(self, dataset: Dataset) -> None:
        self._dataset = dataset.to_list()

    def get_example(self, prompt_column_name: str = "prompt") -> str:
        return random.choice(self._dataset)[prompt_column_name]