Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
change
sglang
Commits
ccfa0841
Unverified
Commit
ccfa0841
authored
Jul 12, 2025
by
Ying Sheng
Committed by
GitHub
Jul 12, 2025
Browse files
[script] update loogle test (#7975)
parent
bcc5ba94
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
python/sglang/eval/loogle_eval.py
python/sglang/eval/loogle_eval.py
+7
-0
No files found.
python/sglang/eval/loogle_eval.py
View file @
ccfa0841
...
@@ -73,6 +73,8 @@ async def benchmark(args):
...
@@ -73,6 +73,8 @@ async def benchmark(args):
tasks
:
List
[
asyncio
.
Task
]
=
[]
tasks
:
List
[
asyncio
.
Task
]
=
[]
for
idx
,
ex
in
enumerate
(
dataset
):
for
idx
,
ex
in
enumerate
(
dataset
):
if
idx
>=
args
.
num_prompts
:
break
tasks
.
append
(
tasks
.
append
(
asyncio
.
create_task
(
asyncio
.
create_task
(
fetch_response
(
fetch_response
(
...
@@ -103,6 +105,8 @@ def analyse(args):
...
@@ -103,6 +105,8 @@ def analyse(args):
hyps
:
List
[
str
]
=
[]
hyps
:
List
[
str
]
=
[]
refs
:
List
[
str
]
=
[]
refs
:
List
[
str
]
=
[]
for
idx
,
ex
in
enumerate
(
tqdm
(
dataset
,
desc
=
"Loading responses"
)):
for
idx
,
ex
in
enumerate
(
tqdm
(
dataset
,
desc
=
"Loading responses"
)):
if
idx
>=
args
.
num_prompts
:
break
pkl_file
=
output_dir
/
f
"response_
{
idx
}
.pkl"
pkl_file
=
output_dir
/
f
"response_
{
idx
}
.pkl"
if
not
pkl_file
.
exists
():
if
not
pkl_file
.
exists
():
raise
FileNotFoundError
(
pkl_file
)
raise
FileNotFoundError
(
pkl_file
)
...
@@ -150,6 +154,9 @@ if __name__ == "__main__":
...
@@ -150,6 +154,9 @@ if __name__ == "__main__":
parser
.
add_argument
(
parser
.
add_argument
(
"--output-dir"
,
default
=
"tmp-output-dir"
,
help
=
"Directory for cached responses"
"--output-dir"
,
default
=
"tmp-output-dir"
,
help
=
"Directory for cached responses"
)
)
parser
.
add_argument
(
"--num-prompts"
,
type
=
int
,
default
=
10000
,
help
=
"Number of prompts to run"
)
args
=
parser
.
parse_args
()
args
=
parser
.
parse_args
()
asyncio
.
run
(
benchmark
(
args
))
asyncio
.
run
(
benchmark
(
args
))
...
...
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