Views
No views yet
1# 安装依赖
2pip install ms-swift -U1# 推理
2swift infer --model_type llama3-8b-instruct --model_id_or_path swift/Llama3-Chinese-8B-Instruct-Agent-v11# 部署
2swift deploy --model_type llama3-8b-instruct --model_id_or_path swift/Llama3-Chinese-8B-Instruct-Agent-v1| 超参数 | 值 |
|---|---|
| lr | 5e-5 |
| epoch | 2 |
| lora_rank | 8 |
| lora_alpha | 32 |
| lora_target_modules | ALL |
| batch_size | 2 |
| gradient_accumulation_steps | 16 |
1NPROC_PER_NODE=8 \
2swift sft \
3 --model_type llama3-8b-instruct \
4 --dataset ms-agent-for-agentfabric-default alpaca-en ms-bench ms-agent-for-agentfabric-addition coig-cqia-ruozhiba coig-cqia-zhihu coig-cqia-exam coig-cqia-chinese-traditional coig-cqia-logi-qa coig-cqia-segmentfault coig-cqia-wiki \
5 --batch_size 2 \
6 --max_length 2048 \
7 --use_loss_scale true \
8 --gradient_accumulation_steps 16 \
9 --learning_rate 5e-5 \
10 --use_flash_attn true \
11 --eval_steps 500 \
12 --save_steps 500 \
13 --train_dataset_sample -1 \
14 --dataset_test_ratio 0.1 \
15 --val_dataset_sample 10000 \
16 --num_train_epochs 2 \
17 --check_dataset_strategy none \
18 --gradient_checkpointing true \
19 --weight_decay 0.01 \
20 --warmup_ratio 0.03 \
21 --save_total_limit 2 \
22 --logging_steps 10 \
23 --sft_type lora \
24 --lora_target_modules ALL \
25 --lora_rank 8 \
26 --lora_alpha 32| 评测模型 | ARC | CEVAL | GSM8K |
|---|---|---|---|
| Llama3-8b-instruct | 0.7645 | 0.5089 | 0.7475 |
| Llama3-Chinese-8B-Instruct-Agent-v1 | 0.7577 | 0.4903 | 0.652 |