jianzhnie / LLamaTuner

Easy and Efficient Finetuning LLMs. (Supported LLama, LLama2, LLama3, Qwen, Baichuan, GLM , Falcon) 大模型高效量化训练+部署.
https://jianzhnie.github.io/llmtech/
Apache License 2.0
561 stars 61 forks source link

数据预处理标签问题 #24

Closed blackxer closed 1 year ago

blackxer commented 1 year ago

您好,对你的数据预处理代码有些疑问,你的labels 和 input 都是直接对应的,labels 不用向右shift 一位吗?

jianzhnie commented 1 year ago

labels 不用向右shift 一位怎么理解呢

blackxer commented 1 year ago

就是自回归模型,比如输入文本是:"今天天气很好",其对应的label就是:"天天气很好<结束符>"

blackxer commented 1 year ago

看了 AutoModelForCausalLM 相关模型的实现源码,其内部实现已经默认对label做了shift操作,谢谢作者