2 Commits

Author SHA1 Message Date
Artyom Iudin
666ee0ca78 [fix] redundant transformers check (#10602) 2026-06-24 16:34:59 +08:00
souljoy
aca54c7f17 [model] add Hy-MT2-1.8B/7B support (#10605) 2026-06-24 16:34:53 +08:00
3 changed files with 47 additions and 1 deletions

View File

@@ -40,7 +40,7 @@ dependencies = [
"torch>=2.4.0", "torch>=2.4.0",
"torchvision>=0.19.0", "torchvision>=0.19.0",
"torchaudio>=2.4.0", "torchaudio>=2.4.0",
"transformers>=4.55.0,<=5.6.0,!=4.52.0,!=4.57.0", "transformers>=4.55.0,<=5.6.0,!=4.57.0",
"datasets>=2.16.0,<=4.0.0", "datasets>=2.16.0,<=4.0.0",
"accelerate>=1.3.0,<=1.11.0", "accelerate>=1.3.0,<=1.11.0",
"peft>=0.18.0,<=0.18.1", "peft>=0.18.0,<=0.18.1",

View File

@@ -1274,6 +1274,30 @@ register_template(
) )
# The following two templates are copied from the official Hy-MT2 chat templates:
# https://github.com/Tencent-Hunyuan/Hy-MT2/blob/main/train/llama_factory_support/hy_dense_template.py
register_template(
name="hy_dense_1_8b",
format_user=StringFormatter(slots=["<hy_User>{{content}}"]),
format_assistant=StringFormatter(slots=["<hy_Assistant>{{content}}"]),
format_system=StringFormatter(slots=["{{content}}<hy_place▁holder▁no▁3>"]),
format_prefix=EmptyFormatter(slots=[{"bos_token"}]),
stop_words=["<hy_place▁holder▁no▁2>"],
efficient_eos=True,
)
register_template(
name="hy_dense_7b",
format_user=StringFormatter(slots=["{{content}}<|extra_0|>"]),
format_assistant=StringFormatter(slots=["{{content}}"]),
format_system=StringFormatter(slots=["{{content}}<|extra_4|>"]),
format_prefix=EmptyFormatter(slots=[{"bos_token"}]),
stop_words=["<|eos|>"],
efficient_eos=True,
)
register_template( register_template(
name="intern2", name="intern2",
format_user=StringFormatter(slots=["<|im_start|>user\n{{content}}<|im_end|>\n<|im_start|>assistant\n"]), format_user=StringFormatter(slots=["<|im_start|>user\n{{content}}<|im_end|>\n<|im_start|>assistant\n"]),

View File

@@ -1248,6 +1248,28 @@ register_model_group(
) )
register_model_group(
models={
"Hy-MT2-1.8B-Instruct": {
DownloadSource.DEFAULT: "tencent/Hy-MT2-1.8B",
DownloadSource.MODELSCOPE: "Tencent-Hunyuan/Hy-MT2-1.8B",
},
},
template="hy_dense_1_8b",
)
register_model_group(
models={
"Hy-MT2-7B-Instruct": {
DownloadSource.DEFAULT: "tencent/Hy-MT2-7B",
DownloadSource.MODELSCOPE: "Tencent-Hunyuan/Hy-MT2-7B",
},
},
template="hy_dense_7b",
)
register_model_group( register_model_group(
models={ models={
"HY-MT1.5-1.8B-Instruct": { "HY-MT1.5-1.8B-Instruct": {