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
ac664bce
Commit
ac664bce
authored
Nov 23, 2023
by
baberabb
Browse files
fix logliklehood_rolling
parent
2362ab41
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
lm_eval/models/vllm_causallms.py
lm_eval/models/vllm_causallms.py
+5
-3
No files found.
lm_eval/models/vllm_causallms.py
View file @
ac664bce
...
...
@@ -37,7 +37,7 @@ class VLLM(LM):
self
.
model
=
LLM
(
model
=
pretrained
,
gpu_memory_utilization
=
0.
2
,
gpu_memory_utilization
=
0.
9
,
revision
=
revision
,
dtype
=
dtype
,
tokenizer_mode
=
tokenizer_mode
,
...
...
@@ -135,7 +135,7 @@ class VLLM(LM):
utils
.
get_rolling_token_windows
(
token_list
=
self
.
tok_encode
(
string
),
prefix_token
=
self
.
eot_token_id
,
max_seq_len
=
self
.
max_length
,
max_seq_len
=
self
.
max_length
-
1
,
context_len
=
1
,
),
)
...
...
@@ -331,7 +331,9 @@ class VLLM(LM):
# Determine if is_greedy
is_greedy
=
True
for
token
,
logprob_dict
in
zip
(
tokens
[
ctxlen
:],
continuation_logprobs_dicts
):
for
token
,
logprob_dict
in
zip
(
tokens
[
ctxlen
:],
continuation_logprobs_dicts
[
ctxlen
:]
):
# Get the token with the maximum log probability from the logprob_dict
if
logprob_dict
:
# Ensure the logprob_dict is not None
top_token
=
max
(
logprob_dict
,
key
=
logprob_dict
.
get
)
...
...
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