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
gaoqiong
lm-evaluation-harness
Commits
103a10e3
Commit
103a10e3
authored
Nov 21, 2023
by
baberabb
Browse files
bugfix
parent
a2920e3d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
lm_eval/models/vllm.py
lm_eval/models/vllm.py
+4
-1
No files found.
lm_eval/models/vllm.py
View file @
103a10e3
...
@@ -80,6 +80,8 @@ class VLLM(LM):
...
@@ -80,6 +80,8 @@ class VLLM(LM):
stop
:
Optional
[
List
[
str
]]
=
None
,
stop
:
Optional
[
List
[
str
]]
=
None
,
**
kwargs
,
**
kwargs
,
):
):
if
"do_sample"
in
kwargs
.
keys
():
kwargs
.
pop
(
"do_sample"
)
if
generate
:
if
generate
:
generate_sampling_params
=
SamplingParams
(
generate_sampling_params
=
SamplingParams
(
max_tokens
=
max_tokens
,
stop
=
stop
,
**
kwargs
max_tokens
=
max_tokens
,
stop
=
stop
,
**
kwargs
...
@@ -181,7 +183,8 @@ class VLLM(LM):
...
@@ -181,7 +183,8 @@ class VLLM(LM):
fn
=
None
,
fn
=
None
,
)
)
for
chunk
in
chunks
:
for
chunk
in
chunks
:
context
,
context_encoding
,
all_gen_kwargs
=
zip
(
*
chunk
)
context_and_encoding
,
all_gen_kwargs
=
zip
(
*
chunk
)
context
,
context_encoding
=
context_and_encoding
# we assume all gen kwargs in the batch are the same
# we assume all gen kwargs in the batch are the same
# this is safe to assume because the `grouper` object ensures it.
# this is safe to assume because the `grouper` object ensures it.
gen_kwargs
=
all_gen_kwargs
[
0
]
gen_kwargs
=
all_gen_kwargs
[
0
]
...
...
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