Skip to content

Commit

Permalink
Add changes suggested by linter
Browse files Browse the repository at this point in the history
  • Loading branch information
kunal-vaishnavi committed Mar 20, 2024
1 parent c44005b commit f0ebf4d
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,11 @@ def main():
inputs["attention_mask"] = torch.cat(
[inputs["attention_mask"], (~has_eos).to(torch.int64).reshape(batch_size, 1)], 1
)
inputs["position_ids"] = None if "position_ids" not in inputs else torch.max(inputs["position_ids"], dim=1)[0].reshape(batch_size, 1) + 1
inputs["position_ids"] = (
None
if "position_ids" not in inputs
else torch.max(inputs["position_ids"], dim=1)[0].reshape(batch_size, 1) + 1
)

# Set logits to zeros for next inference run and re-use memory buffer
if outputs["logits"].shape[1] != 1:
Expand Down

0 comments on commit f0ebf4d

Please sign in to comment.