会話を組み立てる
これまで扱ってきた Llama モデルは、異なる役割(role)からのメッセージとしてプロンプトを受け取れます。この演習では、インターネットサービスプロバイダーのカスタマーサポート用チャットボットに渡すメッセージを作成します。
Llama モデルは llm として利用できます。
この演習はコースの一部です
Llama 3 を使いこなす
演習の手順
convリスト内の会話を完成させ、promptとして与えられた"user"メッセージを含めます。- 会話を Llama モデル
llmに渡し、結果を出力します。
実践的なインタラクティブ演習
このサンプルコードを完成させて、この演習に挑戦してみましょう。
prompt = "Give me four short steps to troubleshoot my internet connection."
conv = [
# Complete the user message
{
"role": "____",
"content": ____
}
]
# Pass the conversation to the model
result = llm.create_chat_completion(messages=____, max_tokens=20)
print(result)