Closed chlinfeng1997 closed 1 year ago
1.想用train_file_dir,可以把hf dataset 的数据集手动下载后,自己解析下json为txt格式就可。
你好,可能我的问题表达不明确,我的问题是医疗的预训练数据为什么是组织成每行<问题+答案>的形式,例如 XXXX?YYYYY,如下图所示:
而不是直接每行是医疗相关的文本,如下所示:
都行,我用的医疗问答百科的数据,他的格式是这样。
另一个问题是通过block_size来划分sequence来训练,推理训练好的预训练模型,输出不会自己截断,会不停输出下去,但是用baichuan7B原始权重进行推理,它却会自己停止,表现为最后一个字符是eos,想问一下对于预训练模型是自己能停止好还是一直不断输出的好呢?还有它能实现输出停止符的原因,是通过每行末尾手动添加停止符来进行训练,还是通过别的什么方法?
达到max length 就会停
ChatGLM2加载后是没有eos_token的,我看微调的时候专门还加了。
tokenizer.add_special_tokens({
"eos_token": "</s>",
"bos_token": "<sop>",
"unk_token": "<unk>",
})
但是实际微调后的模型进行infer的时候,遇到eos_token还是不会自动停止,这是什么原因?
ChatGLM2加载后是没有eos_token的,我看微调的时候专门还加了。
tokenizer.add_special_tokens({ "eos_token": "</s>", "bos_token": "<sop>", "unk_token": "<unk>", })
但是实际微调后的模型进行infer的时候,遇到eos_token还是不会自动停止,这是什么原因?
我昨天也查看了chatglm2的tokenizer.eos_token_id 其实有值 为2 但是感觉没用? 我也把预训练文本末尾加上了 但是二次pretrain之后输出还是一样不中断 直到达到设定的maxlength。
大佬好,这个修改看了一下,没理解为什么可以解决这个BUG?我infer的时候仍然会有大量的,只能自己加split拦截。 顺便问一下,能否帮忙解释一下ChatGLM2的SpecailToken为什么弄得这么奇怪,感觉看得有点晕菜。
ChatGLM2加载后是没有eos_token的,我看微调的时候专门还加了。
tokenizer.add_special_tokens({ "eos_token": "</s>", "bos_token": "<sop>", "unk_token": "<unk>", })
但是实际微调后的模型进行infer的时候,遇到eos_token还是不会自动停止,这是什么原因?
我昨天也查看了chatglm2的tokenizer.eos_token_id 其实有值 为2 但是感觉没用? 我也把预训练文本末尾加上了 但是二次pretrain之后输出还是一样不中断 直到达到设定的maxlength。
我总感觉ChatGLM2在SpecialToken上埋了坑,有点理不顺
感谢您的解答!
Describe the Question
Please provide a clear and concise description of what the question is.
I notice that the pretrain data downloaded from the Hub is organized into JSON format, with each line having a text field containing the question and answer. Is the purpose of doing this to directly output a correctly formatted response during inferencing on pretraining model? Why not in document form, where each line is descriptive text, but in question-answer form as input?