diff --git a/src/llamafactory/data/template.py b/src/llamafactory/data/template.py index f41d74f61..b91f9c1d4 100644 --- a/src/llamafactory/data/template.py +++ b/src/llamafactory/data/template.py @@ -2251,3 +2251,24 @@ register_template( format_system=StringFormatter(slots=["<|system|>\n{{content}}", {"eos_token"}]), default_system="You are Zephyr, a helpful assistant.", ) + + +# copied from glm4_7 template +register_template( + name="aeva", + format_user=StringFormatter(slots=["<|user|>\n{{content}}<|assistant|>"]), + format_assistant=StringFormatter(slots=["\n{{content}}"]), + format_system=StringFormatter(slots=["<|system|>\n{{content}}"]), + format_function=FunctionFormatter(slots=["{{content}}"], tool_format="glm4_moe"), + format_observation=StringFormatter(slots=["<|observation|>\n{{content}}<|assistant|>"]), + format_tools=ToolFormatter(tool_format="glm4_moe"), + format_prefix=EmptyFormatter(slots=["[gMASK]"]), + default_system=( + "You are an AI assistant named Aeva created by Zongzhi Lou. " + "Your answer should be friendly, unbiased, faithful, informative and detailed." + ), + stop_words=["<|user|>", "<|observation|>"], + thought_words=("", ""), + efficient_eos=True, + template_class=Glm47ReasoningTemplate, +) diff --git a/src/llamafactory/extras/constants.py b/src/llamafactory/extras/constants.py index 581105a60..5dfb8f54e 100644 --- a/src/llamafactory/extras/constants.py +++ b/src/llamafactory/extras/constants.py @@ -3474,3 +3474,35 @@ register_model_group( }, template="zephyr", ) + + +register_model_group( + models={ + "Aeva-Flash-Chat": { + DownloadSource.DEFAULT: "louzongzhi/Aeva-Flash", + DownloadSource.MODELSCOPE: "louzongktsi/Aeva-Flash", + DownloadSource.OPENMIND: "louzongzhi/Aeva-Flash", + }, + "Aeva-Air-Chat": { + DownloadSource.DEFAULT: "louzongzhi/Aeva-Air", + DownloadSource.MODELSCOPE: "louzongktsi/Aeva-Air", + DownloadSource.OPENMIND: "louzongzhi/Aeva-Air", + }, + "Aeva-Chat": { + DownloadSource.DEFAULT: "louzongzhi/Aeva", + DownloadSource.MODELSCOPE: "louzongktsi/Aeva", + DownloadSource.OPENMIND: "louzongzhi/Aeva", + }, + "Aeva-Pro-Chat": { + DownloadSource.DEFAULT: "louzongzhi/Aeva-Pro", + DownloadSource.MODELSCOPE: "louzongktsi/Aeva-Pro", + DownloadSource.OPENMIND: "louzongzhi/Aeva-Pro", + }, + "Aeva-Max-Chat": { + DownloadSource.DEFAULT: "louzongzhi/Aeva-Max", + DownloadSource.MODELSCOPE: "louzongktsi/Aeva-Max", + DownloadSource.OPENMIND: "louzongzhi/Aeva-Max", + }, + }, + template="aeva", +)