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
d14b36e8
Unverified
Commit
d14b36e8
authored
Jun 19, 2024
by
Hailey Schoelkopf
Committed by
GitHub
Jun 19, 2024
Browse files
Fix Datasets `--trust_remote_code` (#1998)
parent
a08bc3c8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
lm_eval/__main__.py
lm_eval/__main__.py
+10
-4
No files found.
lm_eval/__main__.py
View file @
d14b36e8
...
...
@@ -354,11 +354,17 @@ def cli_evaluate(args: Union[argparse.Namespace, None] = None) -> None:
# Respect user's value passed in via CLI, otherwise default to True and add to comma-separated model args
if
args
.
trust_remote_code
:
os
.
environ
[
"HF_DATASETS_TRUST_REMOTE_CODE"
]
=
str
(
args
.
trust_remote_code
)
args
.
model_args
=
(
args
.
model_args
+
f
",trust_remote_code=
{
os
.
environ
[
'HF_DATASETS_TRUST_REMOTE_CODE'
]
}
"
eval_logger
.
info
(
"Passed `--trust_remote_code`, setting environment variable `HF_DATASETS_TRUST_REMOTE_CODE=true`"
)
# HACK: import datasets and override its HF_DATASETS_TRUST_REMOTE_CODE value internally,
# because it's already been determined based on the prior env var before launching our
# script--`datasets` gets imported by lm_eval internally before these lines can update the env.
import
datasets
datasets
.
config
.
HF_DATASETS_TRUST_REMOTE_CODE
=
True
args
.
model_args
=
args
.
model_args
+
",trust_remote_code=True"
eval_logger
.
info
(
f
"Selected Tasks:
{
task_names
}
"
)
...
...
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