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
81a11d6d
Commit
81a11d6d
authored
Jul 26, 2023
by
Benjamin Fattori
Browse files
materialze "out" tensor during batch calculation
parent
0a7720e9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
lm_eval/models/huggingface.py
lm_eval/models/huggingface.py
+1
-1
No files found.
lm_eval/models/huggingface.py
View file @
81a11d6d
...
...
@@ -350,7 +350,7 @@ class HFLM(LM):
def
forward_batch
(
batch_size
):
test_batch
=
torch
.
ones
((
batch_size
,
max_length
),
device
=
self
.
device
).
long
()
for
_
in
range
(
5
):
_
=
F
.
log_softmax
(
self
.
_model_call
(
test_batch
),
dim
=-
1
)
.
cpu
()
out
=
F
.
log_softmax
(
self
.
_model_call
(
test_batch
),
dim
=-
1
)
return
batch_size
batch_size
=
forward_batch
()
...
...
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