yuanzhoulvpi2017 / zero_nlp

中文nlp解决方案(大模型、数据、模型、训练、推理)
MIT License
2.85k stars 355 forks source link

code02_训练模型全部流程.ipynb 代码是否有误? #113

Closed ghost closed 1 year ago

ghost commented 1 year ago

get_masks_and_position_ids函数中 attention_mask[..., : mask_position - 1] = 1 是不是要改成attention_mask[..., : seq_len - 1] = 1 ? 参考官方代码def get_attention_mask(tokenizer, input_ids, device): attention_mask[..., :context_len] = 1,此处的context_len = seq_len - 1