From 9a99fbc86d0be7bd0e6dd1a5475868c32006b08d Mon Sep 17 00:00:00 2001 From: hiyouga Date: Mon, 8 Apr 2024 21:28:39 +0800 Subject: [PATCH] tiny fix --- src/llmtuner/data/template.py | 20 ++++++++++++-------- src/llmtuner/extras/constants.py | 31 +++++++++++++++---------------- 2 files changed, 27 insertions(+), 24 deletions(-) diff --git a/src/llmtuner/data/template.py b/src/llmtuner/data/template.py index 88d7cb862a..52358c1e02 100644 --- a/src/llmtuner/data/template.py +++ b/src/llmtuner/data/template.py @@ -441,6 +441,18 @@ def get_template_and_fix_tokenizer( ) +_register_template( + name="breeze", + format_user=StringFormatter(slots=["[INST] {{content}} [/INST] "]), + format_system=StringFormatter(slots=[{"bos_token"}, "{{content}}"]), + default_system=( + "You are a helpful AI assistant built by MediaTek Research. " + "The user you are helping speaks Traditional Chinese and comes from Taiwan." + ), + efficient_eos=True, +) + + _register_template( name="chatglm2", format_user=StringFormatter(slots=["[Round {{idx}}]\n\n问:{{content}}\n\n答:"]), @@ -773,11 +785,3 @@ def get_template_and_fix_tokenizer( format_user=StringFormatter(slots=[":{{content}}\n:"]), format_separator=EmptyFormatter(slots=["\n"]), ) - -_register_template( - name="breeze", - format_user=StringFormatter(slots=["[INST] {{content}} [/INST] "]), - format_system=StringFormatter(slots=[{"bos_token"}, "{{content}}"]), - default_system="You are a helpful AI assistant built by MediaTek Research. The user you are helping speaks Traditional Chinese and comes from Taiwan. ", - efficient_eos=True, -) diff --git a/src/llmtuner/extras/constants.py b/src/llmtuner/extras/constants.py index 38fde71201..729e0fa671 100644 --- a/src/llmtuner/extras/constants.py +++ b/src/llmtuner/extras/constants.py @@ -170,6 +170,19 @@ def register_model_group( ) +register_model_group( + models={ + "Breeze-7B": { + DownloadSource.DEFAULT: "MediaTek-Research/Breeze-7B-Base-v1_0", + }, + "Breeze-7B-Chat": { + DownloadSource.DEFAULT: "MediaTek-Research/Breeze-7B-Instruct-v1_0", + }, + }, + template="breeze", +) + + register_model_group( models={ "ChatGLM2-6B-Chat": { @@ -748,8 +761,8 @@ def register_model_group( DownloadSource.MODELSCOPE: "qwen/Qwen1.5-14B-Chat-AWQ", }, "Qwen1.5-32B-int4-Chat": { - DownloadSource.DEFAULT: "Qwen/Qwen1.5-32B-Chat-GPTQ-Int4", - DownloadSource.MODELSCOPE: "qwen/Qwen1.5-32B-Chat-GPTQ-Int4", + DownloadSource.DEFAULT: "Qwen/Qwen1.5-32B-Chat-AWQ", + DownloadSource.MODELSCOPE: "qwen/Qwen1.5-32B-Chat-AWQ", }, "Qwen1.5-72B-int8-Chat": { DownloadSource.DEFAULT: "Qwen/Qwen1.5-72B-Chat-GPTQ-Int8", @@ -981,17 +994,3 @@ def register_model_group( }, template="atom", ) - -register_model_group( - models={ - "Breeze-7B": { - DownloadSource.DEFAULT: "MediaTek-Research/Breeze-7B-Base-v1_0", - DownloadSource.MODELSCOPE: "MediaTek-Research/Breeze-7B-Base-v1_0", - }, - "Breeze-7B-Chat": { - DownloadSource.DEFAULT: "MediaTek-Research/Breeze-7B-Instruct-v1_0", - DownloadSource.MODELSCOPE: "MediaTek-Research/Breeze-7B-Instruct-v1_0", - } - }, - template="breeze", -)