mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2026-04-30 17:50:04 +08:00
[Bugfix] Fixes prefix-repetition benchmark script (#26828)
Signed-off-by: Kourosh Hakhamaneshi <Kourosh@anyscale.com>
This commit is contained in:
parent
96b9aa5aa0
commit
a2986b3e33
@ -2979,13 +2979,14 @@ class PrefixRepetitionRandomDataset(BenchmarkDataset):
|
|||||||
requests = []
|
requests = []
|
||||||
token_mismatch_total = 0
|
token_mismatch_total = 0
|
||||||
for _ in range(num_prefixes):
|
for _ in range(num_prefixes):
|
||||||
prefix_tokens = _generate_exact_length_tokens(prefix_len)
|
prefix_tokens, prefix_mismatch = _generate_exact_length_tokens(prefix_len)
|
||||||
|
token_mismatch_total += prefix_mismatch
|
||||||
|
|
||||||
for _ in range(prompts_per_prefix):
|
for _ in range(prompts_per_prefix):
|
||||||
suffix_tokens, token_mistmatch = _generate_exact_length_tokens(
|
suffix_tokens, suffix_mismatch = _generate_exact_length_tokens(
|
||||||
suffix_len
|
suffix_len
|
||||||
)
|
)
|
||||||
token_mismatch_total += token_mistmatch
|
token_mismatch_total += suffix_mismatch
|
||||||
combined_tokens = prefix_tokens + suffix_tokens
|
combined_tokens = prefix_tokens + suffix_tokens
|
||||||
prompt = tokenizer.decode(combined_tokens)
|
prompt = tokenizer.decode(combined_tokens)
|
||||||
prompt_len = len(combined_tokens)
|
prompt_len = len(combined_tokens)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user