fix(trainer): 修复多轮对话中的因果注意力掩码计算逻辑等
This commit is contained in:
@@ -99,6 +99,8 @@ def process_attention_mask(
|
||||
return None
|
||||
|
||||
if seq_mask.dim() > 2:
|
||||
# shape (bsz, seq_len) or (bsz,n_heads, seq_len, seq_len + start_pos)
|
||||
# if ndim > 2, it's 4D tensor
|
||||
return seq_mask
|
||||
|
||||
batch_size = seq_mask.size(0)
|
||||
|
||||
Reference in New Issue
Block a user