Checklist / 检查清单
Question Description / 问题描述
微调时,该如何设置,使训练后的模型输出不带\n\n\n\n,是否是应该在权重的chat_template中修改,我的训练配置如下:
swift sft
--model "${MODEL_PATH}"
--tuner_type lora
--dataset "${DATASET_PATH}"
--load_from_cache_file true
--add_non_thinking_prefix true
--loss_scale ignore_empty_think
--split_dataset_ratio 0.01
--torch_dtype bfloat16
--num_train_epochs 3
--per_device_train_batch_size 32
--per_device_eval_batch_size 32
--learning_rate 1e-4
--lora_rank 8
--lora_alpha 32
--target_modules all-linear
--gradient_accumulation_steps 1
--group_by_length true
--output_dir "${OUTPUT_DIR}"
--eval_steps 200
--save_steps 200
--save_total_limit 2
--logging_steps 5
--max_length 2048
--warmup_ratio 0.05
--dataset_num_proc 4
--dataloader_num_workers 4
--deepspeed zero2
--model_author swift \
Checklist / 检查清单
Question Description / 问题描述
微调时,该如何设置,使训练后的模型输出不带\n\n\n\n,是否是应该在权重的chat_template中修改,我的训练配置如下:
swift sft
--model "${MODEL_PATH}"
--tuner_type lora
--dataset "${DATASET_PATH}"
--load_from_cache_file true
--add_non_thinking_prefix true
--loss_scale ignore_empty_think
--split_dataset_ratio 0.01
--torch_dtype bfloat16
--num_train_epochs 3
--per_device_train_batch_size 32
--per_device_eval_batch_size 32
--learning_rate 1e-4
--lora_rank 8
--lora_alpha 32
--target_modules all-linear
--gradient_accumulation_steps 1
--group_by_length true
--output_dir "${OUTPUT_DIR}"
--eval_steps 200
--save_steps 200
--save_total_limit 2
--logging_steps 5
--max_length 2048
--warmup_ratio 0.05
--dataset_num_proc 4
--dataloader_num_workers 4
--deepspeed zero2
--model_author swift \