Skip to content

qwen3.5 0.8B,如何关闭输出<think>\n\n</think>\n\n #9485

@Baboom-l

Description

@Baboom-l

Checklist / 检查清单

  • I have searched existing issues, and this is a new question or discussion topic. / 我已经搜索过现有的 issues,确认这是一个新的问题与讨论。

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 \

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions