Fix: Correctly filter special tokens in benchmark_prefix_caching (#28615)
Signed-off-by: Di Wu <dw2761@nyu.edu>
This commit is contained in:
@@ -69,7 +69,7 @@ def sample_tokens(tokenizer: PreTrainedTokenizerBase, length: int) -> list[int]:
|
|||||||
|
|
||||||
# Remove the special tokens.
|
# Remove the special tokens.
|
||||||
return random.choices(
|
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,
|
k=length,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user