DLLXW / baby-llama2-chinese

用于从头预训练+SFT一个小参数量的中文LLaMa2的仓库;24G单卡即可运行得到一个具备简单中文问答能力的chat-llama2.
MIT License
2.34k stars 288 forks source link

前期数据处理差异 #43

Closed wujianqiangwjq closed 8 months ago

wujianqiangwjq commented 8 months ago

其他预训练llama2数据处理, encode的数据直接是labels: data["labels"] = data["input_ids"].clone() 我们这里数据处理是PretokDataset里面: x = chunk[:-1] y = chunk[1:] yield x, y 这两者有什么区别吗? PretokDataset 改成以下有什么影响: yield chunk,chunk

wujianqiangwjq commented 8 months ago

我明白了,transformers 里面的clm模型在forward会做类似x = chunk[:-1], y = chunk[1:]的动作,所有它喂给模型的数据是(X,X)