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
ce214979
Commit
ce214979
authored
Jul 16, 2023
by
baberabb
Browse files
set fp32 if device=mps
parent
2bb7ce3b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
1 deletion
+3
-1
lm_eval/api/model.py
lm_eval/api/model.py
+2
-0
lm_eval/models/huggingface.py
lm_eval/models/huggingface.py
+1
-1
No files found.
lm_eval/api/model.py
View file @
ce214979
...
...
@@ -114,6 +114,8 @@ class LM(abc.ABC):
additional_config
=
{}
if
additional_config
is
None
else
additional_config
args
=
utils
.
simple_parse_args_string
(
arg_string
)
args2
=
{
k
:
v
for
k
,
v
in
additional_config
.
items
()
if
v
is
not
None
}
if
"device"
in
args
and
args
[
"device"
]
==
"mps"
:
args
[
"dtype"
]
=
"float32"
return
cls
(
**
args
,
**
args2
)
@
property
...
...
lm_eval/models/huggingface.py
View file @
ce214979
...
...
@@ -109,7 +109,7 @@ class HFLM(LM):
eval_logger
.
info
(
f
"Using device '
{
device
}
'"
)
if
device
==
"mps"
:
eval_logger
.
info
(
"MPS is still in beta
;
a
d
d
,dtype=float32 to model_args
."
"MPS is still in beta a
n
d
only supports float32; setting dtype to float32
."
)
else
:
eval_logger
.
info
(
"Device not specified"
)
...
...
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