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
ca57061c
Commit
ca57061c
authored
Mar 26, 2021
by
Leo Gao
Browse files
Patch gpt3lm
parent
bc5478a1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
lm_eval/models/gpt3.py
lm_eval/models/gpt3.py
+4
-1
No files found.
lm_eval/models/gpt3.py
View file @
ca57061c
...
@@ -71,7 +71,10 @@ class GPT3LM(LM):
...
@@ -71,7 +71,10 @@ class GPT3LM(LM):
res
=
[]
res
=
[]
def
_collate
(
x
):
def
_collate
(
x
):
toks
=
self
.
tokenizer
.
encode
(
x
[
0
]
+
x
[
1
])[:
-
1
]
# this doesn't efficiently handle last-token differences yet, but those are kinda annoying because
# it's not guaranteed that the 100 or so logprobs we get to see actually contain all the continuations
# we care about and so we need some kind of backup for when it isn't
toks
=
self
.
tokenizer
.
encode
(
x
[
0
]
+
x
[
1
])
return
(
len
(
toks
),
self
.
tokenizer
.
decode
(
toks
))
return
(
len
(
toks
),
self
.
tokenizer
.
decode
(
toks
))
reord
=
utils
.
Reorderer
(
requests
,
_collate
)
reord
=
utils
.
Reorderer
(
requests
,
_collate
)
...
...
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