Skip to content

Commit bf3e074

Browse files
authored
update acc_strategy & fix citest (#2583)
1 parent ca312cf commit bf3e074

28 files changed

Lines changed: 227 additions & 752 deletions

File tree

‎README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,8 @@ pip install ms-swift -U
255255
- Method 2: Install SWIFT through source code (convenient for running training and inference scripts), please run the following commands:
256256

257257
```shell
258-
git clone https://github.com/modelscope/swift.git
259-
cd swift
258+
git clone https://github.com/modelscope/ms-swift.git
259+
cd ms-swift
260260
pip install -e '.[llm]'
261261
```
262262

‎README_CN.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,8 @@ pip install ms-swift -U
256256
- 方法2:通过源代码安装SWIFT(方便运行训练推理脚本),请运行以下命令:
257257

258258
```shell
259-
git clone https://github.com/modelscope/swift.git
260-
cd swift
259+
git clone https://github.com/modelscope/ms-swift.git
260+
cd ms-swift
261261
pip install -e '.[llm]'
262262
```
263263

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ swift sft \
4646
swift/self-cognition#500 \
4747
--num_train_epochs 1 \
4848
--per_device_train_batch_size 1 \
49+
--per_device_eval_batch_size 1 \
4950
--learning_rate 1e-4 \
5051
--lora_rank 8 \
5152
--lora_alpha 32 \
@@ -56,8 +57,11 @@ swift sft \
5657
--save_total_limit 2 \
5758
--logging_steps 5 \
5859
--max_length 2048 \
59-
--model_author swift \
6060
--output_dir output \
61+
--system 'You are a helpful assistant.' \
62+
--warmup_ratio 0.05 \
63+
--dataloader_num_workers 4 \
64+
--model_author swift \
6165
--model_name swift-robot
6266
```
6367

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ Vera使用`target_modules`, `target_regex`, `modules_to_save`三个参数.
292292
- packing: 是否使用packing,默认为False
293293
- 🔥lazy_tokenize: 是否使用lazy_tokenize,在LLM训练中默认False,MLLM训练中默认True
294294

295-
- acc_strategy: 训练acc的策略,可以为`sentence`和`token`级别的acc,默认为`token`
295+
- acc_strategy: 训练acc的策略,可以为`seq`和`token`级别的acc,默认为`token`
296296
- max_new_tokens: predict_with_generate=True时的最大生成token数量,默认64
297297
- temperature: predict_with_generate=True时的temperature,默认0
298298
- optimizer: plugin的自定义optimizer名称

‎docs/source/Instruction/评测.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ pip install ms-swift[eval] -U
5050
或从源代码安装:
5151

5252
```shell
53-
git clone https://github.com/modelscope/swift.git
54-
cd swift
53+
git clone https://github.com/modelscope/ms-swift.git
54+
cd ms-swift
5555
pip install -e '.[eval]'
5656
```
5757

‎docs/source_en/GetStarted/Quick-start.md‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ swift sft \
4646
swift/self-cognition#500 \
4747
--num_train_epochs 1 \
4848
--per_device_train_batch_size 1 \
49+
--per_device_eval_batch_size 1 \
4950
--learning_rate 1e-4 \
5051
--lora_rank 8 \
5152
--lora_alpha 32 \
@@ -56,8 +57,11 @@ swift sft \
5657
--save_total_limit 2 \
5758
--logging_steps 5 \
5859
--max_length 2048 \
59-
--model_author swift \
6060
--output_dir output \
61+
--system 'You are a helpful assistant.' \
62+
--warmup_ratio 0.05 \
63+
--dataloader_num_workers 4 \
64+
--model_author swift \
6165
--model_name swift-robot
6266
```
6367

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ Training arguments include the [base arguments](#base-arguments), [Seq2SeqTraine
297297
- packing: Whether to use packing, default is False.
298298
- 🔥lazy_tokenize: Whether to use lazy_tokenize, default is False during LLM training, default is True during MLLM training.
299299

300-
- acc_strategy: Strategy for training accuracy, can be `sentence` or `token` level accuracy, default is `token`.
300+
- acc_strategy: Strategy for training accuracy, can be `seq` or `token` level accuracy, default is `token`.
301301
- max_new_tokens: Maximum generated token count when `predict_with_generate=True`, default 64.
302302
- temperature: Temperature when `predict_with_generate=True`, default 0.
303303
- optimizer: Custom optimizer name for plugin.

‎docs/source_en/Instruction/Evaluation.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ pip install ms-swift[eval] -U
5050
Or install from the source code:
5151

5252
```shell
53-
git clone https://github.com/modelscope/swift.git
54-
cd swift
53+
git clone https://github.com/modelscope/ms-swift.git
54+
cd ms-swift
5555
pip install -e '.[eval]'
5656
```
5757

‎examples/custom/infer.sh‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# sh examples/custom/infer.sh
2+
CUDA_VISIBLE_DEVICES=0 \
3+
swift infer \
4+
--ckpt_dir output/vx-xxx/checkpoint-xxx \
5+
--load_dataset_config true \
6+
--infer_backend pt \
7+
--max_batch_size 16 \
8+
--max_new_tokens 256 \
9+
--temperature 0

‎examples/custom/sft.sh‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# sh examples/custom/sft.sh
2+
CUDA_VISIBLE_DEVICES=0 \
3+
swift sft \
4+
--custom_register_path examples/custom/dataset.py \
5+
examples/custom/model.py \
6+
--model AI-ModelScope/Nemotron-Mini-4B-Instruct \
7+
--train_type lora \
8+
--dataset swift/stsb \
9+
--num_train_epochs 3 \
10+
--per_device_train_batch_size 1 \
11+
--per_device_eval_batch_size 1 \
12+
--learning_rate 1e-4 \
13+
--lora_rank 8 \
14+
--lora_alpha 32 \
15+
--target_modules all-linear \
16+
--gradient_accumulation_steps 16 \
17+
--eval_steps 100 \
18+
--save_steps 100 \
19+
--save_total_limit 2 \
20+
--logging_steps 5 \
21+
--warmup_ratio 0.05 \
22+
--dataloader_num_workers 4 \
23+
--max_length 2048 \
24+
--output_dir output

0 commit comments

Comments
 (0)