From 93db02b9825914c6bbddcb661f1134564e3c1d81 Mon Sep 17 00:00:00 2001 From: Di Wu Date: Thu, 13 Nov 2025 14:06:30 +0800 Subject: [PATCH] Fix: Correctly filter special tokens in benchmark_prefix_caching Signed-off-by: Di Wu --- benchmarks/benchmark_prefix_caching.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmarks/benchmark_prefix_caching.py b/benchmarks/benchmark_prefix_caching.py index 146c268a6b7f..28fc383a318d 100644 --- a/benchmarks/benchmark_prefix_caching.py +++ b/benchmarks/benchmark_prefix_caching.py @@ -69,7 +69,7 @@ def sample_tokens(tokenizer: PreTrainedTokenizerBase, length: int) -> list[int]: # Remove the special tokens. return random.choices( - [v for k, v in vocab.items() if k not in all_special_ids], + [v for v in vocab.values() if v not in all_special_ids], k=length, )