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
c2f76ec7
Unverified
Commit
c2f76ec7
authored
Aug 11, 2023
by
Hailey Schoelkopf
Committed by
GitHub
Aug 11, 2023
Browse files
Merge pull request #770 from tju01/big-refactor
[Refactor] Use evaluation mode for accelerate to prevent OOM
parents
7634a6ec
d69a962d
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 @
c2f76ec7
...
...
@@ -289,7 +289,9 @@ class HFLM(LM):
"Failed to place model onto specified device. This may be because the model is quantized via `bitsandbytes`. If the desired GPU is being used, this message is safe to ignore."
)
else
:
self
.
_model
=
accelerator
.
prepare
(
self
.
model
)
self
.
_model
=
accelerator
.
prepare_model
(
self
.
model
,
evaluation_mode
=
True
)
self
.
_device
=
torch
.
device
(
f
"cuda:
{
accelerator
.
local_process_index
}
"
)
self
.
accelerator
=
accelerator
...
...
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