Skip to content

Commit

Permalink
1) Fix incorrect 0-min shift 2) Remove unnecessary ops
Browse files Browse the repository at this point in the history
Signed-off-by: Loc Huynh <[email protected]>
  • Loading branch information
lochuynh1412 committed Dec 3, 2024
1 parent 343d7cc commit 4f2cea1
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def __call__(
mask = np.frombuffer(mask, dtype=np.uint8)

# Force all invalid tokens to have 0 value
logits.add_(torch.min(logits))
logits.add_(-torch.min(logits))
zero_indices = np.where(mask == 0)[0]
logits[zero_indices] = 0.0
non_zero_indices = np.nonzero(mask)[0]
Expand Down

0 comments on commit 4f2cea1

Please sign in to comment.