Unverified Commit d30cf3d0 authored by Yih-Dar's avatar Yih-Dar Committed by GitHub
Browse files

Fix past CI after #24334 (#25113)



update
Co-authored-by: default avatarydshieh <ydshieh@users.noreply.github.com>
parent 224da5df
...@@ -725,7 +725,9 @@ class SequenceBiasLogitsProcessor(LogitsProcessor): ...@@ -725,7 +725,9 @@ class SequenceBiasLogitsProcessor(LogitsProcessor):
torch.tensor(sequence_ids[:-1], dtype=input_ids.dtype, device=input_ids.device), torch.tensor(sequence_ids[:-1], dtype=input_ids.dtype, device=input_ids.device),
).prod(dim=1) ).prod(dim=1)
bias[:, last_token] += torch.where( bias[:, last_token] += torch.where(
matching_rows.bool(), sequence_bias, torch.tensor(0.0, device=input_ids.device) matching_rows.bool(),
torch.tensor(sequence_bias, device=input_ids.device),
torch.tensor(0.0, device=input_ids.device),
) )
# 5 - apply the bias to the scores # 5 - apply the bias to the scores
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment