slicktune.data¶
Dataset loaders for fine-tuning objectives.
Attributes¶
Functions¶
|
Load a KTO unpaired-preference JSONL file. |
|
Load a DPO/ORPO preference JSONL file. |
|
Load probe questions used to verify fine-tuning worked. |
|
Load an SFT JSONL file into a Hugging Face |
Package Contents¶
- slicktune.data.DEFAULT_SYSTEM_PROMPT = 'You answer questions about Amirhessam Tahmassebi, SlickML, and slick-tune accurately and concisely.'¶
- slicktune.data.load_kto_jsonl(path: str | pathlib.Path) datasets.Dataset[source]¶
Load a KTO unpaired-preference JSONL file.
- Parameters:
path (str or Path) – JSONL with
prompt,completion, and booleanlabelper line.- Returns:
datasets.Dataset – Dataset with KTO columns.
- Raises:
FileNotFoundError – If
pathdoes not exist.ValueError – If the file is empty or a row is invalid.
- slicktune.data.load_preference_jsonl(path: str | pathlib.Path) datasets.Dataset[source]¶
Load a DPO/ORPO preference JSONL file.
- Parameters:
path (str or Path) – JSONL with
prompt,chosen, andrejectedper line.- Returns:
datasets.Dataset – Dataset with string preference columns.
- Raises:
FileNotFoundError – If
pathdoes not exist.ValueError – If the file is empty or a row is invalid.
- slicktune.data.load_probe_jsonl(path: str | pathlib.Path) list[dict[str, str]][source]¶
Load probe questions used to verify fine-tuning worked.
- Parameters:
path (str or Path) – JSONL with
promptandmust_contain(substring checks).- Returns:
list[dict[str, str]] – Probe rows with
promptandmust_contain.- Raises:
FileNotFoundError – If
pathdoes not exist.ValueError – If a row is missing required keys.
- slicktune.data.load_sft_jsonl(path: str | pathlib.Path) datasets.Dataset[source]¶
Load an SFT JSONL file into a Hugging Face
Dataset.- Parameters:
path (str or Path) – Path to a
.jsonlfile. Each line is one training example.- Returns:
datasets.Dataset – Dataset with a
messagescolumn.- Raises:
FileNotFoundError – If
pathdoes not exist.ValueError – If the file is empty or a row is invalid.