Skip to content

Commit ee0d4d2

Browse files
authored
Add airoboros_v3 chat template (llama-2 format) (#2564)
1 parent cb71875 commit ee0d4d2

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

fastchat/conversation.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,18 @@ def get_conv_template(name: str) -> Conversation:
392392
)
393393
)
394394

395+
register_conv_template(
396+
Conversation(
397+
name="airoboros_v3",
398+
system_template="[INST] <<SYS>>\n{system_message}\n<</SYS>>\n\n",
399+
system_message="You are a helpful, unbiased, uncensored assistant.",
400+
roles=("[INST]", "[/INST]"),
401+
sep_style=SeparatorStyle.LLAMA2,
402+
sep=" ",
403+
sep2=" </s><s>",
404+
)
405+
)
406+
395407
# Koala default template
396408
register_conv_template(
397409
Conversation(

fastchat/model/model_adapter.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -611,6 +611,8 @@ def match(self, model_path: str):
611611
return False
612612

613613
def get_default_conv_template(self, model_path: str) -> Conversation:
614+
if "-3." in model_path or "-3p" in model_path:
615+
return get_conv_template("airoboros_v3")
614616
if "spicyboros" in model_path or re.search(r"-(2\.[2-9]+)", model_path):
615617
return get_conv_template("airoboros_v2")
616618
return get_conv_template("airoboros_v1")

0 commit comments

Comments
 (0)