Skip to content

Commit 7f3001e

Browse files
committed
Black
1 parent fb468a1 commit 7f3001e

3 files changed

Lines changed: 14 additions & 3 deletions

File tree

keys_values/data/longbench_v2.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,9 @@ def filter_and_transform(
415415
num_used = 0
416416
num_total = 0
417417
if max_seq_length is not None:
418-
print(f"\nProcessing dataset, filtering out records with > {max_seq_length} tokens")
418+
print(
419+
f"\nProcessing dataset, filtering out records with > {max_seq_length} tokens"
420+
)
419421
else:
420422
print(f"\nProcessing dataset")
421423
if seq_lengths is None:

keys_values/data/sequence_classification.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,10 @@ def __getitem__(self, idx: int) -> Dict[str, Any]:
110110
prompt = self.prompt_style.apply(prompt=example["instruction"], **example)
111111
max_length = -1 if self.max_seq_length is None else self.max_seq_length
112112
encoded_prompt = self.tokenizer.encode(
113-
prompt, bos=False, eos=True, max_length=max_length,
113+
prompt,
114+
bos=False,
115+
eos=True,
116+
max_length=max_length,
114117
)
115118
token_counts = {"raw_plus_prompt_template": len(encoded_prompt)}
116119
raw_count = example.get("num_tokens_instruction")

keys_values/kvcache/gradient/inference_replay.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,13 @@ def __init__(
349349
):
350350
extra_kwargs = dict()
351351
# If args are not in `base_kwargs`, take them from `replay_log`
352-
for name in ("tokenizer", "end_initial_regex", "max_initial_fraction", "include_end_string", "pad_id"):
352+
for name in (
353+
"tokenizer",
354+
"end_initial_regex",
355+
"max_initial_fraction",
356+
"include_end_string",
357+
"pad_id",
358+
):
353359
if name not in base_kwargs:
354360
extra_kwargs[name] = getattr(replay_log, name)
355361
SmartInitialLastRecentlyInsertedKVCache.__init__(

0 commit comments

Comments
 (0)