Skip to content

Commit 91c7512

Browse files
committed
Add eos_id option.
Signed-off-by: Frank Di Natale <[email protected]>
1 parent b76190e commit 91c7512

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

tensorrt_llm/bench/benchmark/throughput.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,14 @@
9494
required=False,
9595
help="Pass in a dataset file for parsing instead of stdin.",
9696
)
97+
@optgroup.option(
98+
"--eos_id",
99+
type=int,
100+
default=-1,
101+
required=False,
102+
help=
103+
"Set the end-of-sequence token for the benchmark. Set to -1 to disable EOS.",
104+
)
97105
@optgroup.option(
98106
"--modality",
99107
type=click.Choice(["image", "video"]),
@@ -222,6 +230,7 @@ def throughput_command(
222230
# Parameters from CLI
223231
# Model, experiment, and engine params
224232
dataset_path: Path = params.pop("dataset")
233+
eos_id: int = params.pop("eos_id")
225234
warmup: int = params.get("warmup")
226235
num_requests: int = params.pop("num_requests")
227236
max_seq_len: int = params.pop("max_seq_len")
@@ -333,8 +342,8 @@ def throughput_command(
333342
else:
334343
llm = LLM(**kwargs)
335344

336-
sampling_params = SamplingParams(end_id=-1,
337-
pad_id=-1,
345+
sampling_params = SamplingParams(end_id=eos_id,
346+
pad_id=eos_id,
338347
beam_width=beam_width)
339348

340349
# Perform warmup if requested.

0 commit comments

Comments
 (0)