本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
選項 1:提供您自己的資料準備提示
收集提示並以 .jsonl 檔案格式存放這些提示。JSONL 中的每筆記錄都必須使用下列結構。
-
包含
schemaVersion欄位,此欄位必須具有值bedrock-conversion-2024。 -
[選用] 包含系統提示,此提示指出向模型指派的角色。
-
在
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 指令碼