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
8d7d2132
"dist/common/net.c" did not exist on "ab151b01708b4787686858b8dd21669aa3aa5266"
Unverified
Commit
8d7d2132
authored
Oct 31, 2020
by
Leo Gao
Committed by
GitHub
Oct 31, 2020
Browse files
Put gpt2 in eval mode
parent
0d291df6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
0 deletions
+1
-0
lm_eval/models/gpt2.py
lm_eval/models/gpt2.py
+1
-0
No files found.
lm_eval/models/gpt2.py
View file @
8d7d2132
...
...
@@ -9,6 +9,7 @@ class GPT2LM(LM):
def
__init__
(
self
,
device
=
"cpu"
):
self
.
device
=
torch
.
device
(
device
)
self
.
gpt2
=
transformers
.
GPT2LMHeadModel
.
from_pretrained
(
'gpt2'
).
to
(
self
.
device
)
self
.
gpt2
.
eval
()
self
.
tokenizer
=
transformers
.
GPT2Tokenizer
.
from_pretrained
(
'gpt2'
)
@
classmethod
...
...
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