From 17735f0c13f14ba819c768b5860e5bdb2cb38272 Mon Sep 17 00:00:00 2001 From: liushz Date: Wed, 24 Apr 2024 16:46:25 +0800 Subject: [PATCH] Fix Llama-3 meta template (#1079) Co-authored-by: liuhongwei --- configs/models/hf_llama/hf_llama3_70b_instruct.py | 4 ++-- configs/models/hf_llama/hf_llama3_8b_instruct.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/configs/models/hf_llama/hf_llama3_70b_instruct.py b/configs/models/hf_llama/hf_llama3_70b_instruct.py index 64883815..c19c6615 100644 --- a/configs/models/hf_llama/hf_llama3_70b_instruct.py +++ b/configs/models/hf_llama/hf_llama3_70b_instruct.py @@ -2,8 +2,8 @@ from opencompass.models import HuggingFaceCausalLM _meta_template = dict( round=[ - dict(role="HUMAN", begin="<|begin_of_text|>user<|end_header_id|>\n\n", end="<|eot_id|>"), - dict(role="BOT", begin="<|begin_of_text|>assistant<|end_header_id|>\n\n", end="<|eot_id|>", generate=True), + dict(role="HUMAN", begin="<|start_header_id|>user<|end_header_id|>\n\n", end="<|eot_id|>"), + dict(role="BOT", begin="<|start_header_id|>assistant<|end_header_id|>\n\n", end="<|eot_id|>", generate=True), ], ) diff --git a/configs/models/hf_llama/hf_llama3_8b_instruct.py b/configs/models/hf_llama/hf_llama3_8b_instruct.py index e3eb4812..e0b439d9 100644 --- a/configs/models/hf_llama/hf_llama3_8b_instruct.py +++ b/configs/models/hf_llama/hf_llama3_8b_instruct.py @@ -2,8 +2,8 @@ from opencompass.models import HuggingFaceCausalLM _meta_template = dict( round=[ - dict(role="HUMAN", begin="<|begin_of_text|>user<|end_header_id|>\n\n", end="<|eot_id|>"), - dict(role="BOT", begin="<|begin_of_text|>assistant<|end_header_id|>\n\n", end="<|eot_id|>", generate=True), + dict(role="HUMAN", begin="<|start_header_id|>user<|end_header_id|>\n\n", end="<|eot_id|>"), + dict(role="BOT", begin="<|start_header_id|>assistant<|end_header_id|>\n\n", end="<|eot_id|>", generate=True), ], )