Skip to content

Commit

Permalink
truncation masking
Browse files Browse the repository at this point in the history
  • Loading branch information
sanagno committed Mar 6, 2023
1 parent c58416c commit eb597a5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions model/model_training/custom_datasets/dialogue_collator.py
Expand Up @@ -55,6 +55,7 @@ def __call__(self, features):
)
)
label_mask = np.array(list(map(lambda x: x % 2 == 1, message_indices)))
label_mask[-1] = False # make sure last token is inactive, has an effect only when truncatting
# try:
# label_mask[[i for i in range(len(message_indices)) if message_indices[i] == -2][0] - 1] = True
# except IndexError:
Expand Down

0 comments on commit eb597a5

Please sign in to comment.