Skip to content

Commit 6c5c507

Browse files
committed
skip first and last turn for accuracy
Signed-off-by: Benjamin Chislett <bchislett@nvidia.com>
1 parent e06d926 commit 6c5c507

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

examples/specdec_bench/specdec_bench/metrics/acceptance_rate.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ def process_final(self, text_outputs):
6464
for request_id, turns in self.prompt_ar.items():
6565
self.out["Request_AR"][request_id] = {}
6666
for turn_id, turn in turns.items():
67+
if len(turn) > 1 and turn[0] <= 1:
68+
turn = turn[1:] # Skip prefill if it is 1 or less, indicating no specdec
69+
if len(turn) > 1:
70+
turn = turn[:-1] # Skip final acceptance due to EOS truncating speculation
6771
ar = sum(turn) / len(turn)
6872
self.out["Request_AR"][request_id][turn_id] = ar
6973
all_ar.append(ar)

0 commit comments

Comments
 (0)