Skip to content

Commit 222b676

Browse files
authored
Update finetune_moss.py
1 parent 96b34ae commit 222b676

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: finetune_moss.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def collate_fn(self, batch):
118118
batch_labels.append(label)
119119

120120
batch_input_ids = torch.nn.utils.rnn.pad_sequence(batch_input_ids, batch_first=True, padding_value=self.tokenizer.eos_token_id)
121-
batch_attn_mask = torch.nn.utils.rnn.pad_sequence(batch_input_ids, batch_first=True, padding_value=0).to(torch.bool)
121+
batch_attn_mask = torch.nn.utils.rnn.pad_sequence(batch_attn_mask, batch_first=True, padding_value=0).to(torch.bool)
122122
batch_labels = torch.nn.utils.rnn.pad_sequence(batch_labels, batch_first=True, padding_value=-100)
123123

124124
return batch_input_ids, batch_attn_mask, batch_labels

0 commit comments

Comments
 (0)