Configuration for data formatting
| 37 | |
| 38 | @dataclass |
| 39 | class FormatConfig: |
| 40 | """Configuration for data formatting""" |
| 41 | |
| 42 | # for sft / dpo |
| 43 | prompt_type: PromptType = PromptType.MESSAGES |
| 44 | |
| 45 | # for plaintext input |
| 46 | prompt_key: str = "prompt" # user prompt |
| 47 | response_key: str = "response" # assistant response |
| 48 | system_prompt_key: Optional[str] = None # If set, use the provided system prompt |
| 49 | system_prompt: Optional[str] = None # has lower priority than system_prompt_key |
| 50 | |
| 51 | # for message list input |
| 52 | messages_key: str = "message" |
| 53 | |
| 54 | # for tools |
| 55 | tools_key: str = "tools" |
| 56 | image_key: Optional[str] = None # used for multi-modal data |
| 57 | video_key: Optional[str] = None # used for multi-modal data |
| 58 | |
| 59 | reply_prefix: Optional[str] = None |
| 60 | |
| 61 | # for sample-level task controlling |
| 62 | workflow_key: str = "" |
| 63 | reward_fn_key: str = "" |
| 64 | |
| 65 | # for dpo dataset |
| 66 | chosen_key: str = "chosen" |
| 67 | rejected_key: str = "rejected" |
| 68 | |
| 69 | # for multi-turn sft |
| 70 | enable_concatenated_multi_turn: bool = False |
| 71 | |
| 72 | # for sft / dpo, if None, use model.custom_chat_template |
| 73 | chat_template: Optional[str] = None |
| 74 | enable_thinking: Optional[bool] = None |
| 75 | |
| 76 | |
| 77 | @dataclass |
no outgoing calls