Skip to content

Commit e1c69dc

Browse files
committed
Merge branch 'main' into release/3.0
2 parents 5f2843b + dbeec0f commit e1c69dc

File tree

16 files changed

+84
-33
lines changed

16 files changed

+84
-33
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ CUDA_VISIBLE_DEVICES=0 \
147147
swift infer \
148148
--adapters output/vx-xxx/checkpoint-xxx \
149149
--stream true \
150+
--temperature 0 \
150151
--max_new_tokens 2048
151152

152153
# merge-lora and use vLLM for inference acceleration
@@ -157,6 +158,7 @@ swift infer \
157158
--merge_lora true \
158159
--infer_backend vllm \
159160
--max_model_len 8192 \
161+
--temperature 0 \
160162
--max_new_tokens 2048
161163
```
162164

README_CN.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ CUDA_VISIBLE_DEVICES=0 \
140140
swift infer \
141141
--adapters output/vx-xxx/checkpoint-xxx \
142142
--stream true \
143+
--temperature 0 \
143144
--max_new_tokens 2048
144145

145146
# merge-lora并使用vLLM进行推理加速
@@ -150,6 +151,7 @@ swift infer \
150151
--merge_lora true \
151152
--infer_backend vllm \
152153
--max_model_len 8192 \
154+
--temperature 0 \
153155
--max_new_tokens 2048
154156
```
155157

docs/source/GetStarted/快速开始.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ CUDA_VISIBLE_DEVICES=0 \
6464
swift infer \
6565
--adapters output/vx-xxx/checkpoint-xxx \
6666
--stream true \
67+
--temperature 0 \
6768
--max_new_tokens 2048
6869

6970
# merge-lora并使用vLLM进行推理加速
@@ -74,6 +75,7 @@ swift infer \
7475
--merge_lora true \
7576
--infer_backend vllm \
7677
--max_model_len 8192 \
78+
--temperature 0 \
7779
--max_new_tokens 2048
7880
```
7981

docs/source/Instruction/命令行参数.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
- custom_register_path: 自定义模型、对话模板和数据集注册的`.py`文件路径
1717

1818
### 模型参数
19-
- task_type: 默认为'causal_lm'. 可选为'causal_lm', 'seq_cls'. 例子可以查看[这里](https://github.com/modelscope/ms-swift/tree/main/examples/train/seq_cls).
2019
- 🔥model: 模型id或模型本地路径。如果是自定义模型请配合`model_type``template`使用,具体可以参考[自定义模型](../Customization/自定义模型.md)
2120
- model_type: 模型类型。相同的模型架构、template、模型加载过程被定义为一个model_type
2221
- model_revision: 模型版本
22+
- task_type: 默认为'causal_lm'. 可选为'causal_lm', 'seq_cls'. 例子可以查看[这里](https://github.com/modelscope/ms-swift/tree/main/examples/train/seq_cls).
2323
- 🔥torch_dtype: 模型权重的数据类型,支持`float16`,`bfloat16`,`float32`,默认从config文件中读取
2424
- attn_impl: attention类型,支持`flash_attn`, `sdpa`, `eager`,默认使用sdpa
2525
- num_labels: 分类模型需要指定。代表标签数量,默认为None

docs/source_en/GetStarted/Quick-start.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ CUDA_VISIBLE_DEVICES=0 \
6464
swift infer \
6565
--adapters output/vx-xxx/checkpoint-xxx \
6666
--stream true \
67+
--temperature 0 \
6768
--max_new_tokens 2048
6869

6970
# merge-lora and use vLLM for inference acceleration
@@ -74,6 +75,7 @@ swift infer \
7475
--merge_lora true \
7576
--infer_backend vllm \
7677
--max_model_len 8192 \
78+
--temperature 0 \
7779
--max_new_tokens 2048
7880
```
7981

docs/source_en/Instruction/Command-line-parameters.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ The introduction to command line parameters will cover base arguments, atomic ar
1616
- custom_register_path: The file path for the custom model, chat template, and dataset registration `.py` files.
1717

1818
### Model Arguments
19-
- task_type: Defaults to 'causal_lm'. Options include 'causal_lm' and 'seq_cls'. You can view examples [here](https://github.com/modelscope/ms-swift/tree/main/examples/train/seq_cls).
2019
- 🔥model: Model ID or local path to the model. If it's a custom model, please use it with `model_type` and `template`. The specific details can be referred to in the [Custom Model](../Customization/Custom-model.md).
2120
- model_type: Model type. The same model architecture, template, and loading process define a model_type.
2221
- model_revision: Model version.
2322
- 🔥torch_dtype: Data type for model weights, supports `float16`, `bfloat16`, `float32`, default is read from the config file.
23+
- task_type: Defaults to 'causal_lm'. Options include 'causal_lm' and 'seq_cls'. You can view examples [here](https://github.com/modelscope/ms-swift/tree/main/examples/train/seq_cls).
2424
- attn_impl: Attention type, supports `flash_attn`, `sdpa`, `eager`, default is sdpa.
2525
- num_labels: To be specified for classification models, representing the number of labels, default is None.
2626
- rope_scaling: Rope type, supports `linear` and `dynamic`, to be used with `max_length`.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Here is the command-line style inference code.
2+
CUDA_VISIBLE_DEVICES=0 \
3+
swift infer \
4+
--adapters output/vx-xxx/checkpoint-xxx \
5+
--stream true \
6+
--temperature 0 \
7+
--max_new_tokens 2048

examples/notebook/qwen2.5-self-cognition/self-cognition-sft.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"outputs": [],
2323
"source": [
2424
"# # install ms-swift\n",
25-
"# pip install git+https://github.com/modelscope/ms-swift.git"
25+
"# pip install ms-swift -U"
2626
]
2727
},
2828
{
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Here is the command-line style training code.
2+
# 22GB
3+
CUDA_VISIBLE_DEVICES=0 \
4+
swift sft \
5+
--model Qwen/Qwen2.5-3B-Instruct \
6+
--train_type lora \
7+
--dataset AI-ModelScope/alpaca-gpt4-data-zh#500 \
8+
AI-ModelScope/alpaca-gpt4-data-en#500 \
9+
swift/self-cognition#500 \
10+
--torch_dtype bfloat16 \
11+
--num_train_epochs 1 \
12+
--per_device_train_batch_size 1 \
13+
--per_device_eval_batch_size 1 \
14+
--learning_rate 1e-4 \
15+
--lora_rank 8 \
16+
--lora_alpha 32 \
17+
--target_modules all-linear \
18+
--gradient_accumulation_steps 16 \
19+
--eval_steps 50 \
20+
--save_steps 50 \
21+
--save_total_limit 2 \
22+
--logging_steps 5 \
23+
--max_length 2048 \
24+
--output_dir output \
25+
--system 'You are a helpful assistant.' \
26+
--warmup_ratio 0.05 \
27+
--dataloader_num_workers 4 \
28+
--dataset_num_proc 4 \
29+
--model_author 小黄 'Xiao Huang' \
30+
--model_name '魔搭' 'ModelScope'

examples/notebook/qwen2vl-ocr/ocr-sft.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"outputs": [],
2323
"source": [
2424
"# # install ms-swift\n",
25-
"# pip install git+https://github.com/modelscope/ms-swift.git"
25+
"# pip install ms-swift -U"
2626
]
2727
},
2828
{

0 commit comments

Comments
 (0)