Skip to content

Commit 283caf0

Browse files
Imss27sumitd2
authored andcommitted
[Misc] Fix sampling from sonnet for long context case (vllm-project#9235)
Signed-off-by: Sumit Dubey <[email protected]>
1 parent a1361de commit 283caf0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

benchmarks/benchmark_serving.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,9 @@ def sample_sonnet_requests(
176176
# Sample the rest of lines per request.
177177
sampled_requests: List[Tuple[str, int, int]] = []
178178
for _ in range(num_requests):
179-
sampled_lines = "".join(
180-
prefix_lines +
181-
random.sample(poem_lines, num_input_lines - num_prefix_lines))
179+
num_lines_needed = num_input_lines - num_prefix_lines
180+
sampled_lines = "".join(prefix_lines +
181+
random.choices(poem_lines, k=num_lines_needed))
182182

183183
prompt = f"{base_prompt}{sampled_lines}"
184184
message = [
@@ -536,7 +536,7 @@ def process_one_metric(
536536
# E.g., "Time to First Token"
537537
metric_header: str,
538538
):
539-
# This function print and add statistics of the specified
539+
# This function prints and adds statistics of the specified
540540
# metric.
541541
if metric_attribute_name not in selected_percentile_metrics:
542542
return

0 commit comments

Comments
 (0)