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
65127577
Commit
65127577
authored
May 20, 2023
by
Benjamin Fattori
Browse files
unwrap model to get pos embs
parent
f1372139
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
lm_eval/models/gpt2.py
lm_eval/models/gpt2.py
+4
-1
No files found.
lm_eval/models/gpt2.py
View file @
65127577
...
...
@@ -103,7 +103,10 @@ class HFLM(LM):
return
self
.
gpt2
.
config
.
n_ctx
except
AttributeError
:
# gptneoconfig doesn't have n_ctx apparently
return
self
.
gpt2
.
config
.
max_position_embeddings
if
hasattr
(
self
,
'accelerator'
):
return
self
.
accelerator
.
unwrap_model
(
self
.
gpt2
).
config
.
max_position_embeddings
else
:
return
self
.
gpt2
.
config
.
max_position_embeddings
@
property
def
max_gen_toks
(
self
):
...
...
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