Unverified Commit 95167926 authored by Vicki Boykis's avatar Vicki Boykis Committed by GitHub
Browse files

Setting trust_remote_code to True for HuggingFace datasets compatibility (#1487)

* setting trust_remote_code

* dataset list no notebooks

* respect trust remote code

* Address changes, move cli options and change datasets

* fix task for tests

* headqa

* remove kobest

* pin datasets and address comments

* clean up space
parent e5e35fca
......@@ -201,6 +201,12 @@ def parse_eval_args() -> argparse.Namespace:
"E.g, `--seed 42` sets all three seeds to 42."
),
)
parser.add_argument(
"--trust_remote_code",
default=True,
help="Sets trust_remote_code to True to execute code to create HF Datasets from the Hub",
)
return parser.parse_args()
......@@ -290,6 +296,16 @@ def cli_evaluate(args: Union[argparse.Namespace, None] = None) -> None:
path.mkdir(parents=True, exist_ok=True)
output_path_file = path.joinpath("results.json")
# 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"] = (
args.trust_remote_code if args.trust_remote_code else True
)
args.model_args = (
args.model_args
+ f",trust_remote_code={os.environ['HF_DATASETS_TRUST_REMOTE_CODE']}"
)
eval_logger.info(f"Selected Tasks: {task_names}")
eval_logger.info("Loading selected tasks...")
......
......@@ -14,3 +14,5 @@ metric_list:
higher_is_better: true
metadata:
version: 1.0
dataset_kwargs:
trust_remote_code: true
include: arithmetic_1dc.yaml
task: arithmetic_2da
dataset_name: arithmetic_2da
dataset_kwargs:
trust_remote_code: true
include: arithmetic_1dc.yaml
task: arithmetic_2dm
dataset_name: arithmetic_2dm
dataset_kwargs:
trust_remote_code: true
include: arithmetic_1dc.yaml
task: arithmetic_2ds
dataset_name: arithmetic_2ds
dataset_kwargs:
trust_remote_code: true
include: arithmetic_1dc.yaml
task: arithmetic_3da
dataset_name: arithmetic_3da
dataset_kwargs:
trust_remote_code: true
include: arithmetic_1dc.yaml
task: arithmetic_3ds
dataset_name: arithmetic_3ds
dataset_kwargs:
trust_remote_code: true
include: arithmetic_1dc.yaml
task: arithmetic_4da
dataset_name: arithmetic_4da
dataset_kwargs:
trust_remote_code: true
include: arithmetic_1dc.yaml
task: arithmetic_4ds
dataset_name: arithmetic_4ds
dataset_kwargs:
trust_remote_code: true
include: arithmetic_1dc.yaml
task: arithmetic_5da
dataset_name: arithmetic_5da
dataset_kwargs:
trust_remote_code: true
include: arithmetic_1dc.yaml
task: arithmetic_5ds
dataset_name: arithmetic_5ds
dataset_kwargs:
trust_remote_code: true
......@@ -12,3 +12,5 @@ metric_list:
higher_is_better: true
metadata:
version: 1.0
dataset_kwargs:
trust_remote_code: true
......@@ -20,3 +20,5 @@ metric_list:
higher_is_better: true
metadata:
version: 3.0
dataset_kwargs:
trust_remote_code: true
......@@ -22,3 +22,5 @@ metric_list:
higher_is_better: true
metadata:
version: 3.0
dataset_kwargs:
trust_remote_code: true
......@@ -21,3 +21,5 @@ metric_list:
higher_is_better: True
metadata:
version: 1.0
dataset_kwargs:
trust_remote_code: true
......@@ -21,3 +21,5 @@ metric_list:
higher_is_better: True
metadata:
version: 1.0
dataset_kwargs:
trust_remote_code: true
......@@ -18,3 +18,5 @@ metric_list:
higher_is_better: true
metadata:
version: 1.0
dataset_kwargs:
trust_remote_code: true
......@@ -19,3 +19,5 @@ metric_list:
higher_is_better: true
metadata:
version: 1.0
dataset_kwargs:
trust_remote_code: true
......@@ -25,3 +25,5 @@ filter_list:
- function: "take_first"
metadata:
version: 0.0
dataset_kwargs:
trust_remote_code: true
......@@ -23,3 +23,5 @@ num_fewshot: 0
metadata:
version: 1.0
num_fewshot: 4
dataset_kwargs:
trust_remote_code: true
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment