From f0f80819a03e85a86eb31729c4ab90e9e61aa6ad Mon Sep 17 00:00:00 2001 From: shing100 Date: Mon, 30 Sep 2024 09:17:41 +0900 Subject: [PATCH 1/7] add Exaone3.0 template Former-commit-id: f7478af1d04353ab13236323e3bfb96fd2870fce --- 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={ From 054fdbe186104be76be71e5622b994e64c7bb0af Mon Sep 17 00:00:00 2001 From: shing100 Date: Mon, 30 Sep 2024 09:19:27 +0900 Subject: [PATCH 2/7] update docs Support model Exaone3.0 Former-commit-id: e6fbf8fd7c84cfb11a0a4a173657b1541806b5f9 --- README.md | 1 + README_zh.md | 1 + 2 files changed, 2 insertions(+) diff --git a/README.md b/README.md index e62a9d47..38f252a8 100644 --- a/README.md +++ b/README.md @@ -169,6 +169,7 @@ Compared to ChatGLM's [P-Tuning](https://github.com/THUDM/ChatGLM2-6B/tree/main/ | [ChatGLM3](https://huggingface.co/THUDM) | 6B | chatglm3 | | [Command R](https://huggingface.co/CohereForAI) | 35B/104B | cohere | | [DeepSeek (Code/MoE)](https://huggingface.co/deepseek-ai) | 7B/16B/67B/236B | deepseek | +| [Exaone3.0](https://huggingface.co/LGAI-EXAONE) | 7.8B | exaone | | [Falcon](https://huggingface.co/tiiuae) | 7B/11B/40B/180B | falcon | | [Gemma/Gemma 2/CodeGemma](https://huggingface.co/google) | 2B/7B/9B/27B | gemma | | [GLM-4](https://huggingface.co/THUDM) | 9B | glm4 | diff --git a/README_zh.md b/README_zh.md index b5da9785..f4190c5a 100644 --- a/README_zh.md +++ b/README_zh.md @@ -170,6 +170,7 @@ https://github.com/user-attachments/assets/e6ce34b0-52d5-4f3e-a830-592106c4c272 | [ChatGLM3](https://huggingface.co/THUDM) | 6B | chatglm3 | | [Command R](https://huggingface.co/CohereForAI) | 35B/104B | cohere | | [DeepSeek (Code/MoE)](https://huggingface.co/deepseek-ai) | 7B/16B/67B/236B | deepseek | +| [Exaone3.0](https://huggingface.co/LGAI-EXAONE) | 7.8B | exaone | | [Falcon](https://huggingface.co/tiiuae) | 7B/11B/40B/180B | falcon | | [Gemma/Gemma 2/CodeGemma](https://huggingface.co/google) | 2B/7B/9B/27B | gemma | | [GLM-4](https://huggingface.co/THUDM) | 9B | glm4 | From 7bc7f7d673d9f2c559f8d7f897b4582debbb5d55 Mon Sep 17 00:00:00 2001 From: "Geun, Lim" Date: Mon, 30 Sep 2024 09:24:44 +0900 Subject: [PATCH 3/7] Update README.md Former-commit-id: d014eb931cd9ed70abb8a466281668a0b00ba9f9 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 38f252a8..083b0bb4 100644 --- a/README.md +++ b/README.md @@ -169,7 +169,7 @@ Compared to ChatGLM's [P-Tuning](https://github.com/THUDM/ChatGLM2-6B/tree/main/ | [ChatGLM3](https://huggingface.co/THUDM) | 6B | chatglm3 | | [Command R](https://huggingface.co/CohereForAI) | 35B/104B | cohere | | [DeepSeek (Code/MoE)](https://huggingface.co/deepseek-ai) | 7B/16B/67B/236B | deepseek | -| [Exaone3.0](https://huggingface.co/LGAI-EXAONE) | 7.8B | exaone | +| [Exaone3.0](https://huggingface.co/LGAI-EXAONE) | 7.8B | exaone | | [Falcon](https://huggingface.co/tiiuae) | 7B/11B/40B/180B | falcon | | [Gemma/Gemma 2/CodeGemma](https://huggingface.co/google) | 2B/7B/9B/27B | gemma | | [GLM-4](https://huggingface.co/THUDM) | 9B | glm4 | From 95eede911a49e797710e69dbdc2c0e06fba9400a Mon Sep 17 00:00:00 2001 From: "Geun, Lim" Date: Mon, 30 Sep 2024 09:25:02 +0900 Subject: [PATCH 4/7] Update README_zh.md Former-commit-id: c4bf9d86e14a9d7a5ed5f9c49d73006d13df2707 --- README_zh.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README_zh.md b/README_zh.md index f4190c5a..c3d1e6f8 100644 --- a/README_zh.md +++ b/README_zh.md @@ -170,7 +170,7 @@ https://github.com/user-attachments/assets/e6ce34b0-52d5-4f3e-a830-592106c4c272 | [ChatGLM3](https://huggingface.co/THUDM) | 6B | chatglm3 | | [Command R](https://huggingface.co/CohereForAI) | 35B/104B | cohere | | [DeepSeek (Code/MoE)](https://huggingface.co/deepseek-ai) | 7B/16B/67B/236B | deepseek | -| [Exaone3.0](https://huggingface.co/LGAI-EXAONE) | 7.8B | exaone | +| [Exaone3.0](https://huggingface.co/LGAI-EXAONE) | 7.8B | exaone | | [Falcon](https://huggingface.co/tiiuae) | 7B/11B/40B/180B | falcon | | [Gemma/Gemma 2/CodeGemma](https://huggingface.co/google) | 2B/7B/9B/27B | gemma | | [GLM-4](https://huggingface.co/THUDM) | 9B | glm4 | From 05fabf90951497fd3fc90f2c4f9b3553d2497fa7 Mon Sep 17 00:00:00 2001 From: shing100 Date: Mon, 30 Sep 2024 09:44:21 +0900 Subject: [PATCH 5/7] fix chat template Exaone3.0 Former-commit-id: 2e32864b59c1ef1a78f3eb1c28fbf578cfaa19cd --- README.md | 1 - README_zh.md | 1 - src/llamafactory/data/template.py | 2 -- 3 files changed, 4 deletions(-) diff --git a/README.md b/README.md index 083b0bb4..e62a9d47 100644 --- a/README.md +++ b/README.md @@ -169,7 +169,6 @@ Compared to ChatGLM's [P-Tuning](https://github.com/THUDM/ChatGLM2-6B/tree/main/ | [ChatGLM3](https://huggingface.co/THUDM) | 6B | chatglm3 | | [Command R](https://huggingface.co/CohereForAI) | 35B/104B | cohere | | [DeepSeek (Code/MoE)](https://huggingface.co/deepseek-ai) | 7B/16B/67B/236B | deepseek | -| [Exaone3.0](https://huggingface.co/LGAI-EXAONE) | 7.8B | exaone | | [Falcon](https://huggingface.co/tiiuae) | 7B/11B/40B/180B | falcon | | [Gemma/Gemma 2/CodeGemma](https://huggingface.co/google) | 2B/7B/9B/27B | gemma | | [GLM-4](https://huggingface.co/THUDM) | 9B | glm4 | diff --git a/README_zh.md b/README_zh.md index c3d1e6f8..b5da9785 100644 --- a/README_zh.md +++ b/README_zh.md @@ -170,7 +170,6 @@ https://github.com/user-attachments/assets/e6ce34b0-52d5-4f3e-a830-592106c4c272 | [ChatGLM3](https://huggingface.co/THUDM) | 6B | chatglm3 | | [Command R](https://huggingface.co/CohereForAI) | 35B/104B | cohere | | [DeepSeek (Code/MoE)](https://huggingface.co/deepseek-ai) | 7B/16B/67B/236B | deepseek | -| [Exaone3.0](https://huggingface.co/LGAI-EXAONE) | 7.8B | exaone | | [Falcon](https://huggingface.co/tiiuae) | 7B/11B/40B/180B | falcon | | [Gemma/Gemma 2/CodeGemma](https://huggingface.co/google) | 2B/7B/9B/27B | gemma | | [GLM-4](https://huggingface.co/THUDM) | 9B | glm4 | diff --git a/src/llamafactory/data/template.py b/src/llamafactory/data/template.py index 08988c1c..e7539019 100644 --- a/src/llamafactory/data/template.py +++ b/src/llamafactory/data/template.py @@ -648,10 +648,8 @@ _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, ) From 345f40a6609d77b93936aa074825fcfe9eb66c0e Mon Sep 17 00:00:00 2001 From: hoshi-hiyouga Date: Mon, 30 Sep 2024 16:39:48 +0800 Subject: [PATCH 6/7] Update template.py Former-commit-id: d893289b595c0530b5aeb8902369885118809b86 --- src/llamafactory/data/template.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/llamafactory/data/template.py b/src/llamafactory/data/template.py index e7539019..e832e3ad 100644 --- a/src/llamafactory/data/template.py +++ b/src/llamafactory/data/template.py @@ -649,8 +649,6 @@ _register_template( format_user=StringFormatter(slots=["[|user|]{{content}}\n[|assistant|]"]), format_system=StringFormatter(slots=["[|system|]{{content}}[|endofturn|]\n"]), format_separator=EmptyFormatter(slots=["\n"]), - format_prefix=EmptyFormatter(slots=[""]), - efficient_eos=True, ) From 6c89d93aeae73f8c7ab0614323d8e1aa53cf69f4 Mon Sep 17 00:00:00 2001 From: hoshi-hiyouga Date: Mon, 30 Sep 2024 16:47:52 +0800 Subject: [PATCH 7/7] Update constants.py Former-commit-id: 7c04e1caea38fd1e1e9abcf8ed1bbdc24ddd6df1 --- src/llamafactory/extras/constants.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/llamafactory/extras/constants.py b/src/llamafactory/extras/constants.py index 1bbb4458..7ed20c2b 100644 --- a/src/llamafactory/extras/constants.py +++ b/src/llamafactory/extras/constants.py @@ -471,7 +471,8 @@ register_model_group( template="deepseekcoder", ) -regiter_model_group( + +register_model_group( models={ "EXAONE-3.0-7.8B-Instruct": { DownloadSource.DEFAULT: "LGAI-EXAONE/EXAONE-3.0-7.8B-Instruct",