Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
d65049da
Unverified
Commit
d65049da
authored
Oct 17, 2024
by
Kai Wu
Committed by
GitHub
Oct 17, 2024
Browse files
[Bugfix] Add random_seed to sample_hf_requests in benchmark_serving script (#9013)
Co-authored-by:
Isotr0py
<
2037008807@qq.com
>
parent
eca2c5f7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
benchmarks/benchmark_serving.py
benchmarks/benchmark_serving.py
+4
-2
No files found.
benchmarks/benchmark_serving.py
View file @
d65049da
...
...
@@ -202,6 +202,7 @@ def sample_hf_requests(
dataset_split
:
str
,
num_requests
:
int
,
tokenizer
:
PreTrainedTokenizerBase
,
random_seed
:
int
,
fixed_output_len
:
Optional
[
int
]
=
None
,
)
->
List
[
Tuple
[
str
,
str
,
int
,
Optional
[
Dict
[
str
,
Collection
[
str
]]]]]:
dataset
=
load_dataset
(
dataset_path
,
...
...
@@ -210,8 +211,8 @@ def sample_hf_requests(
streaming
=
True
)
assert
"conversations"
in
dataset
.
features
,
(
"HF Dataset must have 'conversations' column."
)
filter
ed_dataset
=
dataset
.
shuffle
().
filter
(
lambda
x
:
len
(
x
[
"conversations"
])
>=
2
)
filter
_func
=
lambda
x
:
len
(
x
[
"conversations"
])
>=
2
filtered_dataset
=
dataset
.
shuffle
(
seed
=
random_seed
).
filter
(
filter_func
)
sampled_requests
:
List
[
Tuple
[
str
,
int
,
int
,
Dict
[
str
,
Collection
[
str
]]]]
=
[]
for
data
in
filtered_dataset
:
...
...
@@ -646,6 +647,7 @@ def main(args: argparse.Namespace):
dataset_split
=
args
.
hf_split
,
num_requests
=
args
.
num_prompts
,
tokenizer
=
tokenizer
,
random_seed
=
args
.
seed
,
fixed_output_len
=
args
.
hf_output_len
,
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment