ms-swift
ms-swift copied to clipboard
KTO训练数据集报错
Describe the bug
我的kto格式的数据集是这样的
这是我的执行命令: #!/bin/bash source activate swift
CUDA_VISIBLE_DEVICES=0
swift rlhf
--rlhf_type kto
--model_id_or_path /root/autodl-tmp/Qwen2-7B-Chat
--model_type qwen2-7b-instruct
--beta 0.1
--desirable_weight 1.0
--undesirable_weight 1.0
--sft_type lora
--dataset /root/swift/examples/pytorch/llm/kto.json
--num_train_epochs 2
--lora_target_modules ALL
--gradient_checkpointing true
--batch_size 1
--learning_rate 5e-5
--gradient_accumulation_steps 16
--warmup_ratio 0.03
--save_total_limit 2
但是最后还是一直报错KeyError: 'label':
明明数据集内已经有label键 但是我明明就有啊?一直解决不了,搞了一整天了
sorry 已修复 https://github.com/modelscope/swift/pull/1515
label不要用字符串 用true, false
标签不要用字符串用true, false
可以了,感谢。我还想问问,kto数据集支持多轮对话训练吗?
支持的 文档中有KTO的自定义数据集格式样例