Skip to content

Commit 9cf5e67

Browse files
authored
fix template bug (#43)
1 parent d7c6d1c commit 9cf5e67

File tree

20 files changed

+75
-54
lines changed

20 files changed

+75
-54
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ Key features:
3131
## LLM SFT Example
3232
[code link](https://github.com/modelscope/swift/tree/main/examples/pytorch/llm)
3333

34-
1. supported sft method: [lora](https://arxiv.org/abs/2106.09685), [qlora](https://arxiv.org/abs/2305.14314), full(full parameter fine tuning), ...
34+
1. supported SFT methods: [lora](https://arxiv.org/abs/2106.09685), [qlora](https://arxiv.org/abs/2305.14314), full(full parameter fine-tuning)
3535
2. supported models: qwen-7b, [qwen-7b-chat](https://github.com/QwenLM/Qwen-7B), qwen-vl, [qwen-vl-chat](https://github.com/QwenLM/Qwen-VL), baichuan-7b, baichuan-13b, baichuan-13b-chat, chatglm2-6b, chatglm2-6b-32k, llama2-7b, llama2-7b-chat, llama2-13b, llama2-13b-chat, llama2-70b, llama2-70b-chat, openbuddy-llama2-13b, openbuddy-llama-65b, polylm-13b
36-
3. supported feature: quantization, ddp, model parallelism(device map), gradient checkpoint, gradient accumulation steps, push to modelscope hub, custom datasets, multimodal and agent sft, mutli-round chat, ...
36+
3. supported features: quantization, ddp, model parallelism(device map), gradient checkpointing, gradient accumulation, pushing to modelscope hub, custom datasets, multimodal and agent SFT, mutli-round chat, ...
3737
4. supported datasets:
38-
1. nlp: alpaca-en(gpt4), alpaca-zh(gpt4), finance-en, multi-alpaca-all, code-en, instinwild-en, instinwild-zh, cot-en, cot-zh, firefly-all-zh, poetry-zh
39-
2. agent: damo-agent-zh, damo-agent-mini-zh
38+
1. NLP: alpaca-en(gpt4), alpaca-zh(gpt4), finance-en, multi-alpaca-all, code-en, instinwild-en, instinwild-zh, cot-en, cot-zh, firefly-all-zh, poetry-zh, instruct-en, gpt4all-en
39+
2. agent: [damo-agent-zh](https://modelscope.cn/datasets/damo/MSAgent-Bench/summary), damo-agent-mini-zh
4040
3. multi-modal: coco-en
4141
5. supported templates: chatml(qwen), baichuan, chatglm2, llama, openbuddy_llama, default
4242

README_CN.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ SWIFT(Scalable lightWeight Infrastructure for Fine-Tuning)是一个可扩展
2929
## 大模型微调的例子
3030
[code link](https://github.com/modelscope/swift/tree/main/examples/pytorch/llm)
3131

32-
1. 支持的sft方法: [lora](https://arxiv.org/abs/2106.09685), [qlora](https://arxiv.org/abs/2305.14314), 全参数微调, ...
32+
1. 支持的SFT方法: [lora](https://arxiv.org/abs/2106.09685), [qlora](https://arxiv.org/abs/2305.14314), 全参数微调
3333
2. 支持的模型: qwen-7b, [qwen-7b-chat](https://github.com/QwenLM/Qwen-7B), qwen-vl, [qwen-vl-chat](https://github.com/QwenLM/Qwen-VL), baichuan-7b, baichuan-13b, baichuan-13b-chat, chatglm2-6b, chatglm2-6b-32k, llama2-7b, llama2-7b-chat, llama2-13b, llama2-13b-chat, llama2-70b, llama2-70b-chat, openbuddy-llama2-13b, openbuddy-llama-65b, polylm-13b
34-
3. 支持的特性: 模型量化, DDP, 模型并行(device_map), gradient checkpoint, 梯度累加, 支持推送modelscope hub, 自定义数据集, 多模态和agent sft, 多轮对话, ...
34+
3. 支持的特性: 模型量化, DDP, 模型并行(device_map), gradient checkpointing, 梯度累加, 支持推送ModelScope Hub, 自定义数据集, 多模态和Agent SFT, 多轮对话, ...
3535
4. 支持的数据集:
36-
1. nlp: alpaca-en(gpt4), alpaca-zh(gpt4), finance-en, multi-alpaca-all, code-en, instinwild-en, instinwild-zh, cot-en, cot-zh, firefly-all-zh, poetry-zh
37-
2. agent: damo-agent-zh, damo-agent-mini-zh
36+
1. NLP: alpaca-en(gpt4), alpaca-zh(gpt4), finance-en, multi-alpaca-all, code-en, instinwild-en, instinwild-zh, cot-en, cot-zh, firefly-all-zh, poetry-zh, instruct-en, gpt4all-en
37+
2. agent: [damo-agent-zh](https://modelscope.cn/datasets/damo/MSAgent-Bench/summary), damo-agent-mini-zh
3838
3. multi-modal: coco-en
3939
5. 支持的对话模板: chatml(qwen), baichuan, chatglm2, llama, openbuddy_llama, default
4040

examples/pytorch/llm/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515
</p>
1616

1717
## Features
18-
1. supported sft method: [lora](https://arxiv.org/abs/2106.09685), [qlora](https://arxiv.org/abs/2305.14314), full(full parameter fine tuning), ...
18+
1. supported SFT methods: [lora](https://arxiv.org/abs/2106.09685), [qlora](https://arxiv.org/abs/2305.14314), full(full parameter fine-tuning)
1919
2. supported models: qwen-7b, [qwen-7b-chat](https://github.com/QwenLM/Qwen-7B), qwen-vl, [qwen-vl-chat](https://github.com/QwenLM/Qwen-VL), baichuan-7b, baichuan-13b, baichuan-13b-chat, chatglm2-6b, chatglm2-6b-32k, llama2-7b, llama2-7b-chat, llama2-13b, llama2-13b-chat, llama2-70b, llama2-70b-chat, openbuddy-llama2-13b, openbuddy-llama-65b, polylm-13b
20-
3. supported feature: quantization, ddp, model parallelism(device map), gradient checkpoint, gradient accumulation steps, push to modelscope hub, custom datasets, multimodal and agent sft, mutli-round chat, ...
20+
3. supported features: quantization, ddp, model parallelism(device map), gradient checkpointing, gradient accumulation, pushing to modelscope hub, custom datasets, multimodal and agent SFT, mutli-round chat, ...
2121
4. supported datasets:
22-
1. nlp: alpaca-en(gpt4), alpaca-zh(gpt4), finance-en, multi-alpaca-all, code-en, instinwild-en, instinwild-zh, cot-en, cot-zh, firefly-all-zh, poetry-zh
23-
2. agent: damo-agent-zh, damo-agent-mini-zh
22+
1. NLP: alpaca-en(gpt4), alpaca-zh(gpt4), finance-en, multi-alpaca-all, code-en, instinwild-en, instinwild-zh, cot-en, cot-zh, firefly-all-zh, poetry-zh, instruct-en, gpt4all-en
23+
2. agent: [damo-agent-zh](https://modelscope.cn/datasets/damo/MSAgent-Bench/summary), damo-agent-mini-zh
2424
3. multi-modal: coco-en
2525
5. supported templates: chatml(qwen), baichuan, chatglm2, llama, openbuddy_llama, default
2626

@@ -60,7 +60,7 @@ git clone https://github.com/modelscope/swift.git
6060
cd swift/examples/pytorch/llm
6161

6262
# sft(qlora) and infer qwen-7b, Requires 16GB VRAM.
63-
# If you want to use quantification, you need to `pip install bitsandbytes`
63+
# If you want to use quantification, you need to `pip install bitsandbytes -U`
6464
# If you want to push weights into modelscope hub during training, you need to set '--push_to_hub true'
6565
bash scripts/qwen_7b_chat/qlora/sft.sh
6666
bash scripts/qwen_7b_chat/qlora/infer.sh

examples/pytorch/llm/README_CN.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616

1717

1818
## 特性
19-
1. 支持的sft方法: [lora](https://arxiv.org/abs/2106.09685), [qlora](https://arxiv.org/abs/2305.14314), 全参数微调, ...
19+
1. 支持的SFT方法: [lora](https://arxiv.org/abs/2106.09685), [qlora](https://arxiv.org/abs/2305.14314), 全参数微调
2020
2. 支持的模型: qwen-7b, [qwen-7b-chat](https://github.com/QwenLM/Qwen-7B), qwen-vl, [qwen-vl-chat](https://github.com/QwenLM/Qwen-VL), baichuan-7b, baichuan-13b, baichuan-13b-chat, chatglm2-6b, chatglm2-6b-32k, llama2-7b, llama2-7b-chat, llama2-13b, llama2-13b-chat, llama2-70b, llama2-70b-chat, openbuddy-llama2-13b, openbuddy-llama-65b, polylm-13b
21-
3. 支持的特性: 模型量化, DDP, 模型并行(device_map), gradient checkpoint, 梯度累加, 支持推送modelscope hub, 自定义数据集, 多模态和agent sft, 多轮对话, ...
21+
3. 支持的特性: 模型量化, DDP, 模型并行(device_map), gradient checkpointing, 梯度累加, 支持推送ModelScope Hub, 自定义数据集, 多模态和Agent SFT, 多轮对话, ...
2222
4. 支持的数据集:
23-
1. nlp: alpaca-en(gpt4), alpaca-zh(gpt4), finance-en, multi-alpaca-all, code-en, instinwild-en, instinwild-zh, cot-en, cot-zh, firefly-all-zh, poetry-zh
24-
2. agent: damo-agent-zh, damo-agent-mini-zh
23+
1. NLP: alpaca-en(gpt4), alpaca-zh(gpt4), finance-en, multi-alpaca-all, code-en, instinwild-en, instinwild-zh, cot-en, cot-zh, firefly-all-zh, poetry-zh, instruct-en, gpt4all-en
24+
2. agent: [damo-agent-zh](https://modelscope.cn/datasets/damo/MSAgent-Bench/summary), damo-agent-mini-zh
2525
3. multi-modal: coco-en
2626
5. 支持的对话模板: chatml(qwen), baichuan, chatglm2, llama, openbuddy_llama, default
2727

@@ -62,7 +62,7 @@ git clone https://github.com/modelscope/swift.git
6262
cd swift/examples/pytorch/llm
6363

6464
# 微调(qlora)+推理 qwen-7b, 需要16GB显存.
65-
# 如果你想要使用量化, 你需要`pip install bitsandbytes`
65+
# 如果你想要使用量化, 你需要`pip install bitsandbytes -U`
6666
# 如果你想在训练时, 将权重push到modelscope hub中, 你需要设置`--push_to_hub true`
6767
bash scripts/qwen_7b_chat/qlora/sft.sh
6868
bash scripts/qwen_7b_chat/qlora/infer.sh

examples/pytorch/llm/scripts/qwen_7b/qlora_ddp/sft.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ torchrun \
77
src/llm_sft.py \
88
--model_type qwen-7b \
99
--sft_type lora \
10-
--template_type chatml \
10+
--template_type default \
1111
--dtype bf16 \
1212
--output_dir runs \
1313
--ddp_backend nccl \
@@ -21,6 +21,7 @@ torchrun \
2121
--lora_alpha 16 \
2222
--lora_dropout_p 0.05 \
2323
--lora_target_modules ALL \
24+
--gradient_checkpointing true \
2425
--batch_size 1 \
2526
--weight_decay 0. \
2627
--learning_rate 1e-4 \

examples/pytorch/llm/scripts/qwen_7b_chat/full/sft.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ python src/llm_sft.py \
1111
--dataset_sample -1 \
1212
--num_train_epochs 1 \
1313
--max_length 1024 \
14+
--gradient_checkpointing true \
1415
--batch_size 1 \
1516
--weight_decay 0.01 \
1617
--learning_rate 1e-5 \

examples/pytorch/llm/scripts/qwen_7b_chat/lora_ddp/sft.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ torchrun \
1818
--lora_rank 8 \
1919
--lora_alpha 32 \
2020
--lora_dropout_p 0.05 \
21+
--gradient_checkpointing true \
2122
--batch_size 1 \
2223
--weight_decay 0. \
2324
--learning_rate 1e-4 \

examples/pytorch/llm/scripts/qwen_7b_chat/qlora/sft.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ python src/llm_sft.py \
1616
--lora_alpha 16 \
1717
--lora_dropout_p 0.05 \
1818
--lora_target_modules ALL \
19+
--gradient_checkpointing true \
1920
--batch_size 1 \
2021
--weight_decay 0. \
2122
--learning_rate 1e-4 \

examples/pytorch/llm/scripts/qwen_7b_chat/qlora_ddp/sft.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ torchrun \
2121
--lora_alpha 16 \
2222
--lora_dropout_p 0.05 \
2323
--lora_target_modules ALL \
24+
--gradient_checkpointing true \
2425
--batch_size 1 \
2526
--weight_decay 0. \
2627
--learning_rate 1e-4 \

examples/pytorch/llm/scripts/qwen_agent/qlora_ddp/sft.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ torchrun \
2121
--lora_alpha 16 \
2222
--lora_dropout_p 0.05 \
2323
--lora_target_modules ALL \
24+
--gradient_checkpointing true \
2425
--batch_size 1 \
2526
--weight_decay 0. \
2627
--learning_rate 1e-4 \

0 commit comments

Comments
 (0)