From 0a633f80985b0c492967fb3e24fb25865fea9e9f 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: 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={ From b5eb939ce363651249467d29c450fbe8b9ce0a25 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: 826675ff14ddfd291e93c91373df9da43d1388a6 --- 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 73b684c7b0f01186f55fd04dc6d9ed96dd62c165 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: d06440e0e71f02f852a7eac5ea6961c8da2a80f4 --- 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 5f1209bee68c6fbeedd21e7f7760e0737462fcdc 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: 0dfe9f763b09e00457700111e5d7d0d8b9a81e32 --- 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 b596102bd56c03b821d038852fa53acfbfa72bad 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: 2964b20eb59687e24a901926c0da1547d7c046ca --- 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 54e749d1cfa299f339fece4e4da7e436b3de1b0d 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: 02957fc9c3cd04ef5140f093642b94e74ce86b61 --- 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 85ed108fa63c20cf41903e9ca6ebf75648578634 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: 4d7bb692348717d89bd5c682890e98bce5118743 --- 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",