diff --git a/README.md b/README.md index c057a4c6..9920fd87 100644 --- a/README.md +++ b/README.md @@ -238,6 +238,7 @@ Compared to ChatGLM's [P-Tuning](https://github.com/THUDM/ChatGLM2-6B/tree/main/ | [GPT-2](https://huggingface.co/openai-community) | 0.1B/0.4B/0.8B/1.5B | - | | [Granite 3.0-3.1](https://huggingface.co/ibm-granite) | 1B/2B/3B/8B | granite3 | | [Index](https://huggingface.co/IndexTeam) | 1.9B | index | +| [Hunyuan](https://huggingface.co/tencent/) | 7B | hunyuan | | [InternLM 2-3](https://huggingface.co/internlm) | 7B/8B/20B | intern2 | | [Llama](https://github.com/facebookresearch/llama) | 7B/13B/33B/65B | - | | [Llama 2](https://huggingface.co/meta-llama) | 7B/13B/70B | llama2 | diff --git a/README_zh.md b/README_zh.md index 8b09090e..8758a4f8 100644 --- a/README_zh.md +++ b/README_zh.md @@ -239,6 +239,7 @@ https://github.com/user-attachments/assets/e6ce34b0-52d5-4f3e-a830-592106c4c272 | [GLM-4](https://huggingface.co/THUDM) | 9B | glm4 | | [GPT-2](https://huggingface.co/openai-community) | 0.1B/0.4B/0.8B/1.5B | - | | [Granite 3.0-3.1](https://huggingface.co/ibm-granite) | 1B/2B/3B/8B | granite3 | +| [Hunyuan](https://huggingface.co/tencent/) | 7B | hunyuan | | [Index](https://huggingface.co/IndexTeam) | 1.9B | index | | [InternLM 2-3](https://huggingface.co/internlm) | 7B/8B/20B | intern2 | | [Llama](https://github.com/facebookresearch/llama) | 7B/13B/33B/65B | - | diff --git a/src/llamafactory/data/template.py b/src/llamafactory/data/template.py index 1d8dbee7..8d077fbd 100644 --- a/src/llamafactory/data/template.py +++ b/src/llamafactory/data/template.py @@ -876,6 +876,16 @@ register_template( ) +register_template( + name="hunyuan", + format_user=StringFormatter(slots=["<|bos|>user\n{{content}}<|eos|>\n<|bos|>assistant\n"]), + format_assistant=StringFormatter(slots=["{{content}}<|eos|>\n"]), + format_system=StringFormatter(slots=["<|bos|>system\n{{content}}<|eos|>\n"]), + format_prefix=EmptyFormatter(slots=["<|bos|>"] ), + stop_words=["<|eos|>"] +) + + register_template( name="intern", format_user=StringFormatter(slots=["<|User|>:{{content}}\n<|Bot|>:"]), diff --git a/src/llamafactory/extras/constants.py b/src/llamafactory/extras/constants.py index a6bde0dd..ee2b9e66 100644 --- a/src/llamafactory/extras/constants.py +++ b/src/llamafactory/extras/constants.py @@ -809,6 +809,17 @@ register_model_group( ) +register_model_group( + models={ + "Hunyuan-7B-Instruct": { + DownloadSource.DEFAULT: "tencent/Hunyuan-7B-Instruct", + DownloadSource.MODELSCOPE: "AI-ModelScope/Hunyuan-7B-Instruct", + }, + }, + template="hunyuan", +) + + register_model_group( models={ "Index-1.9B-Base": {