-
Notifications
You must be signed in to change notification settings - Fork 314
Open
Description
Teacher Forcing是指的是输入和输出错开一个位置,从而使得模型能够具有预测能力。
但是博主在这里的数据集代码并没有使得输入输出错开:
# ChatGLM3需要增加[gMASK]、sop两个标记
input_ids = [tokenizer.get_command("[gMASK]"),
tokenizer.get_command("sop")] + src_tokens + tgt_tokens + [tokenizer.eos_token_id]
context_length = len(src_tokens) + 2
labels = [-100] * context_length + input_ids[context_length:]
加上input[1,2,3], output[4,5,6],经过上述代码处理变成,其中64790为gmask,64792为sop,2为eos
[64790, 64792, 1, 2, 3, 4, 5, 6, 2]
[-100, 64792, 1, 2, 3, 4, 5, 6, 2]
这是为什么?是不是写错了?
Metadata
Metadata
Assignees
Labels
No labels