torchtune.data¶
Instruct templates¶
Interface for instruction templates. |
|
Prompt template for Alpaca-style datasets. |
|
Prompt template for grammar correction datasets. |
|
Prompt template to format datasets for summarization tasks. |
Chat formats¶
Interface for chat formats. |
|
OpenAI's Chat Markup Language used by their chat models. |
|
Chat format that formats human and system prompts with appropriate tags used in Llama2 pre-training. |
|
Formats according to Mistral's instruct model. |
Types¶
This dataclass represents individual messages in an instruction or chat dataset. |
Converters¶
Convert a chat sample adhering to the ShareGPT format to the Llama2 chat format. |
Helper funcs¶
Given a list of messages, ensure that messages form a valid back-and-forth conversation. |