ms-swift icon indicating copy to clipboard operation
ms-swift copied to clipboard

多轮对话是否支持自定义选择某几轮不计算loss

Open zht8506 opened this issue 1 year ago • 3 comments

你好,感谢你出色的工作。我采用该框架,对qwen进行多轮对话微调,每一条数据是多条人机对话,其中多条机器人的回复会一起计算loss。因为数据质量不高,中间某几轮的回复我不想计算loss。我想问一下是否支持多轮对话微调时,对中间几轮不计算loss,比如通过加tag或者修改loss的方式。

zht8506 avatar Aug 01 '25 08:08 zht8506

loss_scale https://swift.readthedocs.io/zh-cn/latest/Customization/%E6%8F%92%E4%BB%B6%E5%8C%96.html#loss-scale

hjh0119 avatar Aug 01 '25 08:08 hjh0119

你好,感谢你出色的工作。我采用该框架,对qwen进行多轮对话微调,每一条数据是多条人机对话,其中多条机器人的回复会一起计算loss。因为数据质量不高,中间某几轮的回复我不想计算loss。我想问一下是否支持多轮对话微调时,对中间几轮不计算loss,比如通过加tag或者修改loss的方式。

请问最终是如何解决的可以分享一下么

pt-coder avatar Sep 17 '25 03:09 pt-coder

现在ms-swift支持这个功能了https://swift.readthedocs.io/zh-cn/latest/Customization/Custom-dataset.html#id4

zht8506 avatar Nov 23 '25 11:11 zht8506