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
341663a9
Commit
341663a9
authored
Jan 31, 2022
by
researcher2
Browse files
Small fixes
parent
55e62507
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
7 deletions
+3
-7
lm_eval/models/gpt2.py
lm_eval/models/gpt2.py
+2
-2
main.py
main.py
+1
-5
No files found.
lm_eval/models/gpt2.py
View file @
341663a9
...
@@ -15,12 +15,12 @@ class HFLM(BaseLM):
...
@@ -15,12 +15,12 @@ class HFLM(BaseLM):
if
device
:
if
device
:
if
device
not
in
[
"cuda"
,
"cpu"
]:
if
device
not
in
[
"cuda"
,
"cpu"
]:
device
=
int
(
device
)
device
=
int
(
device
)
self
.
device
=
torch
.
device
(
device
)
self
.
_
device
=
torch
.
device
(
device
)
print
(
f
"Using device '
{
device
}
'"
)
print
(
f
"Using device '
{
device
}
'"
)
else
:
else
:
print
(
"Device not specificed"
)
print
(
"Device not specificed"
)
print
(
f
"Cuda Available?
{
torch
.
cuda
.
is_available
()
}
"
)
print
(
f
"Cuda Available?
{
torch
.
cuda
.
is_available
()
}
"
)
self
.
device
=
torch
.
device
(
'cuda'
)
if
torch
.
cuda
.
is_available
()
else
torch
.
device
(
'cpu'
)
self
.
_
device
=
torch
.
device
(
'cuda'
)
if
torch
.
cuda
.
is_available
()
else
torch
.
device
(
'cpu'
)
# TODO: update this to be less of a hack once subfolder is fixed in HF
# TODO: update this to be less of a hack once subfolder is fixed in HF
self
.
gpt2
=
transformers
.
AutoModelForCausalLM
.
from_pretrained
(
self
.
gpt2
=
transformers
.
AutoModelForCausalLM
.
from_pretrained
(
...
...
main.py
View file @
341663a9
...
@@ -43,6 +43,7 @@ def parse_args():
...
@@ -43,6 +43,7 @@ def parse_args():
parser
.
add_argument
(
'--decontaminate'
,
action
=
"store_true"
)
parser
.
add_argument
(
'--decontaminate'
,
action
=
"store_true"
)
parser
.
add_argument
(
'--ngrams_path'
,
default
=
None
)
parser
.
add_argument
(
'--ngrams_path'
,
default
=
None
)
parser
.
add_argument
(
'--ngrams_n_size'
,
type
=
int
,
default
=
None
)
parser
.
add_argument
(
'--ngrams_n_size'
,
type
=
int
,
default
=
None
)
parser
.
add_argument
(
'--description_dict_path'
,
default
=
None
)
return
parser
.
parse_args
()
return
parser
.
parse_args
()
...
@@ -67,11 +68,6 @@ def pattern_match(patterns, source_list):
...
@@ -67,11 +68,6 @@ def pattern_match(patterns, source_list):
task_names
.
add
(
matching
)
task_names
.
add
(
matching
)
return
list
(
task_names
)
return
list
(
task_names
)
def
main
():
parser
.
add_argument
(
'--description_dict_path'
,
default
=
None
)
return
parser
.
parse_args
()
def
main
():
def
main
():
args
=
parse_args
()
args
=
parse_args
()
if
not
ensure_correct_decontamination_params
(
args
):
if
not
ensure_correct_decontamination_params
(
args
):
...
...
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