bake_examples() turns rows with known answers into the conversations a
generative student learns (contract/baked.md, "The examples table"): one
row per conversation, function, messages (the prompt, then the reply:
the loss belongs on the reply only), tag, weight, row_id, split
("train" or "validation") and source. They are the messages the
student is called with, in every language. export_examples() writes them
as JSON lines, with <path>.meta.json beside it saying what made them, for
any trainer (TRL's SFTTrainer, Axolotl, Unsloth, a service's upload).
Python's functai.bake trains on them itself.
Arguments
- fn
An AI function.
- rows
Rows with known answers: a data frame with its input and output columns (from
rated(), say).- fixed
Inputs with one value in every row, left out of what the student reads:
list(guidance = "Keep every number.").- derived
Inputs decided by another input the student still reads:
list(guidance = "section").- reasoning
Whether the student learns the reasoning too (a function with
.module = "cot").- layout
The layout it is trained with (default: the function's).
- validation
The share of rows held out for validation.
- seed
The seed choosing them.
- weight, tag
Columns of
rowsgiving each row's weight and tag.- path
The JSON lines file to write.
- ...
Options of
bake_examples().