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
bff97e59
Commit
bff97e59
authored
Jul 03, 2024
by
Nathan Habib
Browse files
use type specified in args for softlogmax function
parent
775d5d85
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
lm_eval/models/huggingface.py
lm_eval/models/huggingface.py
+3
-2
No files found.
lm_eval/models/huggingface.py
View file @
bff97e59
...
@@ -1124,10 +1124,11 @@ class HFLM(TemplateLM):
...
@@ -1124,10 +1124,11 @@ class HFLM(TemplateLM):
"labels"
:
batched_conts
,
"labels"
:
batched_conts
,
}
}
logits
=
self
.
_model_call
(
batched_inps
,
**
call_kwargs
)
multi_logits
=
F
.
log_softmax
(
multi_logits
=
F
.
log_softmax
(
self
.
_model_call
(
batched_inps
,
**
call_kwargs
)
,
logits
,
dim
=-
1
,
dim
=-
1
,
# dtype=
torch.float16
,
# dtype=
logits.dtype
,
)
# [batch, padding_length (inp or cont), vocab]
)
# [batch, padding_length (inp or cont), vocab]
for
(
request_str
,
ctx_tokens
,
_
),
logits
,
inplen
,
cont_toks
in
zip
(
for
(
request_str
,
ctx_tokens
,
_
),
logits
,
inplen
,
cont_toks
in
zip
(
...
...
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