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
3c805576
Commit
3c805576
authored
Jun 20, 2023
by
lintangsutawika
Browse files
reformat for pre-commit
parent
6b375468
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
8 deletions
+6
-8
docs/new_task_guide.md
docs/new_task_guide.md
+1
-1
lm_eval/models/hf_causal.py
lm_eval/models/hf_causal.py
+3
-3
lm_eval/utils.py
lm_eval/utils.py
+2
-4
No files found.
docs/new_task_guide.md
View file @
3c805576
lm_eval/models/hf_causal.py
View file @
3c805576
...
@@ -23,7 +23,7 @@ class HFLM(LM):
...
@@ -23,7 +23,7 @@ class HFLM(LM):
pretrained
=
"gpt2"
,
pretrained
=
"gpt2"
,
revision
=
"main"
,
revision
=
"main"
,
low_cpu_mem_usage
=
None
,
low_cpu_mem_usage
=
None
,
dtype
:
Optional
[
Union
[
str
,
torch
.
dtype
]]
=
"auto"
,
dtype
:
Optional
[
Union
[
str
,
torch
.
dtype
]]
=
"auto"
,
subfolder
=
None
,
subfolder
=
None
,
tokenizer
=
None
,
tokenizer
=
None
,
batch_size
=
1
,
batch_size
=
1
,
...
...
lm_eval/utils.py
View file @
3c805576
...
@@ -421,9 +421,7 @@ def clear_torch_cache():
...
@@ -421,9 +421,7 @@ def clear_torch_cache():
torch
.
cuda
.
empty_cache
()
torch
.
cuda
.
empty_cache
()
def
get_dtype
(
def
get_dtype
(
dtype
:
Union
[
str
,
torch
.
dtype
])
->
torch
.
dtype
:
dtype
:
Union
[
str
,
torch
.
dtype
]
)
->
torch
.
dtype
:
"""Converts `dtype` from `str` to torch.dtype when possible. Does not use an instantiated HF AutoConfig"""
"""Converts `dtype` from `str` to torch.dtype when possible. Does not use an instantiated HF AutoConfig"""
if
isinstance
(
dtype
,
str
)
and
dtype
!=
"auto"
:
if
isinstance
(
dtype
,
str
)
and
dtype
!=
"auto"
:
# Convert `str` args torch dtype: `float16` -> `torch.float16`
# Convert `str` args torch dtype: `float16` -> `torch.float16`
...
...
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