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
3ddfa4a6
Unverified
Commit
3ddfa4a6
authored
May 14, 2021
by
Leo Gao
Committed by
GitHub
May 14, 2021
Browse files
Merge pull request #182 from EleutherAI/sdtblck-patch-1
Update gpt2.py
parents
8a61f771
ebe9e6b9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
3 deletions
+1
-3
lm_eval/models/gpt2.py
lm_eval/models/gpt2.py
+1
-3
No files found.
lm_eval/models/gpt2.py
View file @
3ddfa4a6
...
@@ -71,10 +71,8 @@ class GPT2LM(LM):
...
@@ -71,10 +71,8 @@ class GPT2LM(LM):
loglikelihoods
=
[]
loglikelihoods
=
[]
with
torch
.
no_grad
():
with
torch
.
no_grad
():
for
string
,
in
tqdm
(
requests
):
for
string
,
in
tqdm
(
requests
):
encoded
=
self
.
tokenizer
.
encode_plus
(
string
)[
"input_ids"
]
rolling_token_windows
=
list
(
map
(
utils
.
make_disjoint_window
,
utils
.
get_rolling_token_windows
(
rolling_token_windows
=
list
(
map
(
utils
.
make_disjoint_window
,
utils
.
get_rolling_token_windows
(
token_list
=
encoded
,
token_list
=
self
.
tokenizer
.
encode
(
string
)
,
prefix_token
=
self
.
EOT_TOKEN_ID
,
prefix_token
=
self
.
EOT_TOKEN_ID
,
max_seq_len
=
self
.
max_length
,
max_seq_len
=
self
.
max_length
,
context_len
=
1
,
context_len
=
1
,
...
...
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