增强配置
以下是增强配置的类定义。
class AugmentationConfig():
base_model: str = "gpt-4o-mini", # gpt-4-turbo, gpt-4-1106-preview, gpt-4-0125-preview, gpt-4o,gpt-4o-2024-08-06, gpt-4o-mini
augmentation_strategy: str = "mixture_of_agents" # mixture_of_agents, single_pass
num_samples_to_generate: int = 1000, # Number of samples to generate
num_seed_samples: str | int = "all", # Optional - number of examples to use as seed samples from the dataset
task_context: str = "", # Optional - provide a context for the task to help the model. If not provided, the model will infer context.
基础模型
在创建您的AugmentationConfig时,base_model是一个必需参数。目前我们支持以下选项:
- gpt-4-turbo
- gpt-4-1106-preview
- gpt-4-0125-preview
- gpt-4o
- gpt-4o-2024-08-06
- gpt-4o-mini
OpenAI costs
请注意,调用此增强函数时将产生OpenAI API费用。我们建议从augmentation_strategy: "single_pass"开始,使用较小的num_samples_to_generate和更便宜的OpenAI模型。
默认值
Predibase为AugmentationConfig中的其余属性设置了以下默认值(可能会更改):
- augmentation_strategy (默认值: "mixture_of_agents"): 支持的选项有
mixture_of_agents和single_pass。查看每种策略的工作原理 这里。 - num_samples_to_generate (默认值: 1000): 推荐值为10、25、50、100、200、500、1000。
- num_seed_samples (默认值: "all"): 从您的种子数据集中用作合成数据集生成过程示例的样本数量。可以设置为"all"以使用所有样本,或者如果您只想使用部分行,可以设置为1到数据集大小之间的值。
- task_context (默认值: ""): 您可以使用此参数为合成数据集流程提供更多关于任务的上下文信息,例如高级任务描述、需要注意的数据集细节、提示列和完成列各自代表什么等。如果未提供,Predibase将使用基础模型根据种子样本智能推断任务上下文(见下文):
任务上下文推断
当未提供task_context时,Predibase会使用您的种子数据集来推断任务上下文。这些推断结果会在后续的LLM调用中用于引导模型生成有用、一致且准确的数据。我们尝试推断的一些关键方面包括:
- 根据术语和上下文识别数据所属的通用领域。
- 描述数据的特征,例如格式、结构和长度。
- 理解任务的性质,包括'Prompt'和'Completion'字段的作用。
- 识别数据中的重复模式或独特实例。
- 评估模糊情况,并根据置信度建议可能的情景。
- 确保数据集的结构在合成示例中得到准确反映。
- 注意记录任何可能有助于理解数据集的附加属性或元数据。
还有更多功能!