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
a5b1c7a8
Commit
a5b1c7a8
authored
Jul 22, 2024
by
Nathan Habib
Browse files
fix dtype
parent
bd6718e4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
lm_eval/models/huggingface.py
lm_eval/models/huggingface.py
+3
-3
No files found.
lm_eval/models/huggingface.py
View file @
a5b1c7a8
...
...
@@ -292,6 +292,7 @@ class HFLM(TemplateLM):
self
.
batch_schedule
=
1
self
.
batch_sizes
=
{}
self
.
max_batch_size
=
max_batch_size
self
.
dtype
=
get_dtype
(
dtype
)
if
str
(
batch_size
).
startswith
(
"auto"
):
batch_size
=
batch_size
.
split
(
":"
)
...
...
@@ -1124,11 +1125,10 @@ class HFLM(TemplateLM):
"labels"
:
batched_conts
,
}
logits
=
self
.
_model_call
(
batched_inps
,
**
call_kwargs
)
multi_logits
=
F
.
log_softmax
(
logits
,
self
.
_model_call
(
batched_inps
,
**
call_kwargs
)
,
dim
=-
1
,
dtype
=
logits
.
dtype
,
dtype
=
self
.
dtype
,
)
# [batch, padding_length (inp or cont), vocab]
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