1. 原因
Roberta 模型的輸入,不能包括token_type_ids,否則就會出現上述bug
2. 解決方案
將token_type_ids輸入設置爲None
inputs = {
"input_ids": input_ids,
"token_type_ids": None,
"attention_mask": attention_mask,
"labels": labels
}
1. 原因
Roberta 模型的輸入,不能包括token_type_ids,否則就會出現上述bug
2. 解決方案
將token_type_ids輸入設置爲None
inputs = {
"input_ids": input_ids,
"token_type_ids": None,
"attention_mask": attention_mask,
"labels": labels
}