Skip to content

Commit 505dfe9

Browse files
committed
unit test for llama3 chat template
1 parent 38321cb commit 505dfe9

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Tests/Runtime/TestLLMChatTemplates.cs

+9
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,15 @@ public void TestLLama2Chat()
6262
);
6363
}
6464

65+
[Test]
66+
public void TestLLama3Chat()
67+
{
68+
Assert.AreEqual(
69+
new LLama3ChatTemplate().ComputePrompt(messages, "assistant"),
70+
"<|begin_of_text|><|start_header_id|>system<|end_header_id|>\n\nyou are a bot<|eot_id|><|start_header_id|>user<|end_header_id|>\n\nHello, how are you?<|eot_id|><|start_header_id|>assistant<|end_header_id|>\n\nI'm doing great. How can I help you today?<|eot_id|><|start_header_id|>user<|end_header_id|>\n\nI'd like to show off how chat templating works!<|eot_id|><|start_header_id|>assistant<|end_header_id|>\n\nchat template is awesome<|eot_id|><|start_header_id|>user<|end_header_id|>\n\ndo you think so?<|eot_id|><|start_header_id|>assistant<|end_header_id|>\n\n"
71+
);
72+
}
73+
6574
[Test]
6675
public void TestAlpaca()
6776
{

0 commit comments

Comments
 (0)