Skip to content

Commit f67ff25

Browse files
committed
Run black
1 parent 18f9727 commit f67ff25

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

keys_values/kvcache/smart_lastrec.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,12 +401,16 @@ def _set_init_length(self, token_idx: torch.Tensor):
401401
for bpos, tokens in enumerate(token_idx):
402402
tokens = tokens.tolist()
403403
try:
404-
num_left_pad = next(i for i, t in enumerate(tokens) if t != self._pad_id)
404+
num_left_pad = next(
405+
i for i, t in enumerate(tokens) if t != self._pad_id
406+
)
405407
tokens = tokens[num_left_pad:]
406408
decoded = self.tokenizer.decode(tokens, skip_special_tokens=True)
407409
match = re.search(self.end_initial_regex, decoded)
408410
except StopIteration:
409-
print(f"SmartInitialLastRecentlyInsertedKVCache._set_init_length (bpos={bpos}): Sequence is all padding")
411+
print(
412+
f"SmartInitialLastRecentlyInsertedKVCache._set_init_length (bpos={bpos}): Sequence is all padding"
413+
)
410414
num_left_pad = None
411415
match = None
412416
decoded = None

0 commit comments

Comments
 (0)