Skip to content

tinker_cookbook.renderers.TrainOnWhat

class tinker_cookbook.renderers.TrainOnWhat(StrEnum)

Enum controlling which parts of the sequence to compute loss on.

Members: LAST_ASSISTANT_MESSAGE: Train only on the final assistant message. LAST_ASSISTANT_TURN: Train on the last assistant turn (including any tool calls and tool responses leading to the final assistant reply). ALL_ASSISTANT_MESSAGES: Train on every assistant message in the conversation. ALL_MESSAGES: Train on all messages regardless of role. ALL_TOKENS: Train on every token in the sequence (including special tokens). ALL_USER_AND_SYSTEM_MESSAGES: Train on user and system messages only. CUSTOMIZED: Use per-message train flags from the dataset.