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

python
def formatting_prompts_func(examples: Any, tokenizer: Any) -> Any

Parameters

ParamField Any

No description available.

ParamField Any

No description available.

Returns

ResponseField Any

The result of the operation.

Uses

  • tokenizer.apply_chat_template

Source

View on GitHub

praisonai/train.py at line 28