Formatting Prompts Func • AI Agents Framework
formatting_prompts_func: Converts each example's conversation into a single plain-text prompt.
formatting_prompts_func
Function
</div>
This function is defined in the train module.
Converts each example’s conversation into a single plain-text prompt. If the example has a “conversations” field, process it as ShareGPT-style. Otherwise, assume Alpaca-style data with “instruction”, “input”, and “output” fields.
Signature
def formatting_prompts_func(examples: Any, tokenizer: Any) -> AnyParameters
ParamField
AnyNo description available.
ParamField
AnyNo description available.
Returns
ResponseField
AnyThe result of the operation.
Uses
tokenizer.apply_chat_template
Source
View on GitHubpraisonai/train.py at line 28