Skip to content

Commit

Permalink
Fix yi template (modelscope#2067)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jintao-Huang committed Sep 19, 2024
1 parent 4ffcf84 commit 7a41e04
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions docs/source/Instruction/支持的模型和数据集.md
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,7 @@
|infinity-instruct|[swift/Infinity-Instruct](https://modelscope.cn/datasets/swift/Infinity-Instruct/summary)||-|Dataset is too huge, please click the original link to view the dataset stat.|qa, quality, multi-task|[BAAI/Infinity-Instruct](https://huggingface.co/datasets/BAAI/Infinity-Instruct)|
|llava-med-zh-instruct|[swift/llava-med-zh-instruct-60k](https://modelscope.cn/datasets/swift/llava-med-zh-instruct-60k/summary)||56649|207.7±67.6, min=37, max=657|zh, medical, vqa|[BUAADreamer/llava-med-zh-instruct-60k](https://huggingface.co/datasets/BUAADreamer/llava-med-zh-instruct-60k)|
|🔥longwriter-6k|[ZhipuAI/LongWriter-6k](https://modelscope.cn/datasets/ZhipuAI/LongWriter-6k/summary)||6000|4887.2±2879.2, min=117, max=30354|long, chat, sft|[THUDM/LongWriter-6k](https://huggingface.co/datasets/THUDM/LongWriter-6k)|
|🔥longwriter-6k-filtered|[swift/longwriter-6k-filtered](https://modelscope.cn/datasets/swift/longwriter-6k-filtered/summary)||666|4108.9±2636.9, min=1190, max=17050|long, chat, sft|-|
|math-instruct|[AI-ModelScope/MathInstruct](https://modelscope.cn/datasets/AI-ModelScope/MathInstruct/summary)||262283|254.4±183.5, min=11, max=4383|math, cot, en, quality|[TIGER-Lab/MathInstruct](https://huggingface.co/datasets/TIGER-Lab/MathInstruct)|
|math-plus|[TIGER-Lab/MATH-plus](https://modelscope.cn/datasets/TIGER-Lab/MATH-plus/summary)|train|893929|287.1±158.7, min=24, max=2919|qa, math, en, quality|[TIGER-Lab/MATH-plus](https://huggingface.co/datasets/TIGER-Lab/MATH-plus)|
|moondream2-coyo-5M|[swift/moondream2-coyo-5M-captions](https://modelscope.cn/datasets/swift/moondream2-coyo-5M-captions/summary)||-|Dataset is too huge, please click the original link to view the dataset stat.|caption, pretrain, quality|[isidentical/moondream2-coyo-5M-captions](https://huggingface.co/datasets/isidentical/moondream2-coyo-5M-captions)|
Expand Down
1 change: 0 additions & 1 deletion docs/source/LLM/DPO训练文档.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ MASTER_PORT=29500 \
swift rlhf \
--rlhf_type dpo \
--model_type yi-6b-chat \
--ref_model_type yi-6b-chat \
--model_revision master \
--sft_type lora \
--tuner_backend swift \
Expand Down
1 change: 1 addition & 0 deletions docs/source_en/Instruction/Supported-models-datasets.md
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,7 @@ The table below introduces the datasets supported by SWIFT:
|infinity-instruct|[swift/Infinity-Instruct](https://modelscope.cn/datasets/swift/Infinity-Instruct/summary)||-|Dataset is too huge, please click the original link to view the dataset stat.|qa, quality, multi-task|[BAAI/Infinity-Instruct](https://huggingface.co/datasets/BAAI/Infinity-Instruct)|
|llava-med-zh-instruct|[swift/llava-med-zh-instruct-60k](https://modelscope.cn/datasets/swift/llava-med-zh-instruct-60k/summary)||56649|207.7±67.6, min=37, max=657|zh, medical, vqa|[BUAADreamer/llava-med-zh-instruct-60k](https://huggingface.co/datasets/BUAADreamer/llava-med-zh-instruct-60k)|
|🔥longwriter-6k|[ZhipuAI/LongWriter-6k](https://modelscope.cn/datasets/ZhipuAI/LongWriter-6k/summary)||6000|4887.2±2879.2, min=117, max=30354|long, chat, sft|[THUDM/LongWriter-6k](https://huggingface.co/datasets/THUDM/LongWriter-6k)|
|🔥longwriter-6k-filtered|[swift/longwriter-6k-filtered](https://modelscope.cn/datasets/swift/longwriter-6k-filtered/summary)||666|4108.9±2636.9, min=1190, max=17050|long, chat, sft|-|
|math-instruct|[AI-ModelScope/MathInstruct](https://modelscope.cn/datasets/AI-ModelScope/MathInstruct/summary)||262283|254.4±183.5, min=11, max=4383|math, cot, en, quality|[TIGER-Lab/MathInstruct](https://huggingface.co/datasets/TIGER-Lab/MathInstruct)|
|math-plus|[TIGER-Lab/MATH-plus](https://modelscope.cn/datasets/TIGER-Lab/MATH-plus/summary)|train|893929|287.1±158.7, min=24, max=2919|qa, math, en, quality|[TIGER-Lab/MATH-plus](https://huggingface.co/datasets/TIGER-Lab/MATH-plus)|
|moondream2-coyo-5M|[swift/moondream2-coyo-5M-captions](https://modelscope.cn/datasets/swift/moondream2-coyo-5M-captions/summary)||-|Dataset is too huge, please click the original link to view the dataset stat.|caption, pretrain, quality|[isidentical/moondream2-coyo-5M-captions](https://huggingface.co/datasets/isidentical/moondream2-coyo-5M-captions)|
Expand Down
1 change: 0 additions & 1 deletion docs/source_en/LLM/DPO.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ MASTER_PORT=29500 \
swift rlhf \
--rlhf_type dpo \
--model_type yi-6b-chat \
--ref_model_type yi-6b-chat \
--model_revision master \
--sft_type lora \
--tuner_backend swift \
Expand Down
1 change: 0 additions & 1 deletion examples/pytorch/llm/scripts/dpo/lora/dpo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
CUDA_VISIBLE_DEVICES=0 \
swift dpo \
--model_type yi-6b-chat \
--ref_model_type yi-6b-chat \
--model_revision master \
--sft_type lora \
--tuner_backend swift \
Expand Down
1 change: 0 additions & 1 deletion examples/pytorch/llm/scripts/dpo/lora_ddp_mp/dpo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ NPROC_PER_NODE=$nproc_per_node \
MASTER_PORT=29500 \
swift dpo \
--model_type yi-6b-chat \
--ref_model_type yi-6b-chat \
--model_revision master \
--sft_type lora \
--tuner_backend swift \
Expand Down
4 changes: 4 additions & 0 deletions swift/llm/utils/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ class TemplateType:
chatml = 'chatml'
# compatibility. (Deprecated)
default_generation_bos = 'default-generation-bos'
yi = 'yi'
yi1_5 = 'yi1_5'

@classmethod
def get_template_name_list(cls) -> List[str]:
Expand Down Expand Up @@ -1282,6 +1284,8 @@ class QwenVLGenerationTemplate(_QwenVLTemplateMixin, DefaultGenerationTemplate):
register_template(TemplateType.qwen_vl_generation, QwenVLGenerationTemplate())

register_template(TemplateType.chatml, ChatmlTemplate())
register_template(TemplateType.yi, ChatmlTemplate())
register_template(TemplateType.yi1_5, ChatmlTemplate())

register_template(
TemplateType.modelscope_agent,
Expand Down

0 comments on commit 7a41e04

Please sign in to comment.