Skip to content

Commit

Permalink
update attention mask
Browse files Browse the repository at this point in the history
  • Loading branch information
gongel committed Sep 26, 2022
1 parent 28ea1e2 commit 2e44dda
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion model_zoo/gpt/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ def _construct_sample(self, tokens):
loss_mask[np.where(np.array(tokens) == self.eos_id)] = 0.0
position_ids = np.arange(0, seq_length, dtype="int64")

attention_mask = loss_mask
attention_mask = np.ones(seq_length, dtype="int64")
labels = np.array(labels, dtype="int64")
return [tokens, loss_mask, attention_mask, position_ids, labels]

Expand Down

0 comments on commit 2e44dda

Please sign in to comment.