From 0a633f80985b0c492967fb3e24fb25865fea9e9f Mon Sep 17 00:00:00 2001 From: shing100 Date: Mon, 30 Sep 2024 09:17:41 +0900 Subject: [PATCH] add Exaone3.0 template Former-commit-id: 3a9569647f5dbb1dcd9ef6e5cfc39ec8f9b41e89 --- src/llamafactory/data/template.py | 12 ++++++++++++ src/llamafactory/extras/constants.py | 9 +++++++++ 2 files changed, 21 insertions(+) diff --git a/src/llamafactory/data/template.py b/src/llamafactory/data/template.py index 7a10a0e3..08988c1c 100644 --- a/src/llamafactory/data/template.py +++ b/src/llamafactory/data/template.py @@ -644,6 +644,18 @@ _register_template( ) +_register_template( + name="exaone", + format_user=StringFormatter(slots=["[|user|]{{content}}\n[|assistant|]"]), + format_system=StringFormatter(slots=["[|system|]{{content}}[|endofturn|]\n"]), + format_assistant=StringFormatter(slots=["{{content}}[|endofturn|]\n"]), + format_separator=EmptyFormatter(slots=["\n"]), + format_prefix=EmptyFormatter(slots=[""]), + stop_words=["[|endofturn|]"], + efficient_eos=True, +) + + _register_template( name="falcon", format_user=StringFormatter(slots=["User: {{content}}\nFalcon:"]), diff --git a/src/llamafactory/extras/constants.py b/src/llamafactory/extras/constants.py index 87436bc7..1bbb4458 100644 --- a/src/llamafactory/extras/constants.py +++ b/src/llamafactory/extras/constants.py @@ -471,6 +471,15 @@ register_model_group( template="deepseekcoder", ) +regiter_model_group( + models={ + "EXAONE-3.0-7.8B-Instruct": { + DownloadSource.DEFAULT: "LGAI-EXAONE/EXAONE-3.0-7.8B-Instruct", + }, + }, + template="exaone", +) + register_model_group( models={