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
fc63c7af
Commit
fc63c7af
authored
Jul 17, 2023
by
haileyschoelkopf
Browse files
edge case for P-Tuning in causal LM
parent
3362727d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
lm_eval/models/huggingface.py
lm_eval/models/huggingface.py
+3
-1
No files found.
lm_eval/models/huggingface.py
View file @
fc63c7af
...
...
@@ -634,8 +634,10 @@ class HFLM(LM):
contlen
=
len
(
cont_toks
)
# take only logits in the continuation
# (discard context toks if decoder-only ; discard right-padding)
# also discards + checks for "virtual tokens" in the causal LM's input window
# from prompt/prefix tuning tokens, if applicable
ctx_len
=
(
inplen
inplen
+
(
logits
.
shape
[
0
]
-
padding_len_inp
)
if
self
.
AUTO_MODEL_CLASS
==
transformers
.
AutoModelForCausalLM
else
None
)
...
...
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