[Benchmark][Bug] Fix multiple bugs in bench and add args to spec_decode offline (#20083)

This commit is contained in:
Ekagra Ranjan
2025-06-25 22:06:27 -07:00
committed by GitHub
parent 2582683566
commit 9502c38138
4 changed files with 29 additions and 12 deletions
+2 -1
View File
@@ -349,8 +349,9 @@ class RandomDataset(BenchmarkDataset):
# [1650, 939, 486] -> ['Ġcall', 'sh', 'ere']
# To avoid uncontrolled change of the prompt length,
# the encoded sequence is truncated before being decode again.
total_input_len = prefix_len + int(input_lens[i])
re_encoded_sequence = tokenizer.encode(prompt, add_special_tokens=False)[
: input_lens[i]
:total_input_len
]
prompt = tokenizer.decode(re_encoded_sequence)
total_input_len = len(re_encoded_sequence)