选项 1:为数据准备提供您自己的提示 - Amazon Bedrock

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

选项 1:为数据准备提供您自己的提示

收集您的提示并以 .jsonl 文件格式存储它们。JSONL 中的每条记录都必须使用以下结构。

  • 添加必须具有值 bedrock-conversion-2024 的字段 schemaVersion

  • [可选] 添加一个系统提示,指示分配给模型的角色。

  • messages 字段中,添加包含提供给模型的输入提示的用户角色。

  • [可选] 在 messages 字段中,添加包含所需响应的助手角色。

Anthropic 和 Meta Llama 模型仅支持单轮对话提示,这意味着您只能有一个用户提示。这些 Amazon Nova 模型支持多轮对话,使您可以在一条记录中提供多个用户和助手之间的交流内容。

示例格式

{ "schemaVersion": "bedrock-conversation-2024", "system": [{ "text": "A chat between a curious User and an artificial intelligence Bot. The Bot gives helpful, detailed, and polite answers to the User's questions." }], "messages": [{ "role": "user", "content": [{ "text": "why is the sky blue" }] }, { "role": "assistant", "content": [{ "text": "The sky is blue because molecules in the air scatter blue light from the Sun more than other colors." }] } ] }}

验证数据集

在运行蒸馏作业之前,您可以使用 Python 脚本验证输入数据集。