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
bff237e6
Commit
bff237e6
authored
Oct 20, 2023
by
Zhiwei Zhuang
Browse files
change huggingface_login from str to bool for privacy
parent
0c5de3ac
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
lm_eval/__main__.py
lm_eval/__main__.py
+9
-5
No files found.
lm_eval/__main__.py
View file @
bff237e6
...
@@ -111,9 +111,9 @@ def parse_eval_args() -> argparse.Namespace:
...
@@ -111,9 +111,9 @@ def parse_eval_args() -> argparse.Namespace:
help
=
"Log error when tasks are not registered."
,
help
=
"Log error when tasks are not registered."
,
)
)
parser
.
add_argument
(
parser
.
add_argument
(
"--huggingface_
toke
n"
,
"--huggingface_
logi
n"
,
type
=
str
,
action
=
"store_true"
,
default
=
Non
e
,
default
=
Fals
e
,
help
=
"huggingface token for downloading some authorization datasets, like toxigen, https://huggingface.co/settings/tokens"
,
help
=
"huggingface token for downloading some authorization datasets, like toxigen, https://huggingface.co/settings/tokens"
,
)
)
return
parser
.
parse_args
()
return
parser
.
parse_args
()
...
@@ -132,10 +132,14 @@ def cli_evaluate(args: Union[argparse.Namespace, None] = None) -> None:
...
@@ -132,10 +132,14 @@ def cli_evaluate(args: Union[argparse.Namespace, None] = None) -> None:
" --limit SHOULD ONLY BE USED FOR TESTING."
" --limit SHOULD ONLY BE USED FOR TESTING."
"REAL METRICS SHOULD NOT BE COMPUTED USING LIMIT."
"REAL METRICS SHOULD NOT BE COMPUTED USING LIMIT."
)
)
if
args
.
huggingface_
toke
n
:
if
args
.
huggingface_
logi
n
:
from
huggingface_hub
import
login
from
huggingface_hub
import
login
login
(
token
=
args
.
huggingface_token
)
assert
(
"HUGGINGFACE_LOGIN_TOKEN"
in
os
.
environ
),
"Your environment variable does not contain a HUGGINGFACE_LOGIN_TOKEN. Please set the token first."
huggingface_token
=
os
.
environ
[
"HUGGINGFACE_LOGIN_TOKEN"
]
login
(
token
=
huggingface_token
)
if
args
.
include_path
is
not
None
:
if
args
.
include_path
is
not
None
:
eval_logger
.
info
(
f
"Including path:
{
args
.
include_path
}
"
)
eval_logger
.
info
(
f
"Including path:
{
args
.
include_path
}
"
)
include_path
(
args
.
include_path
)
include_path
(
args
.
include_path
)
...
...
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