Unverified Commit 904bba12 authored by Baber Abbasi's avatar Baber Abbasi Committed by GitHub
Browse files

Pin datasets < 4.0.0 (#3172)

* Fix: pin datasets < 4.0

* fix

* update type hints in HF

* fix hellaswag path
parent 2eea3f50
...@@ -433,8 +433,10 @@ def cli_evaluate(args: Union[argparse.Namespace, None] = None) -> None: ...@@ -433,8 +433,10 @@ def cli_evaluate(args: Union[argparse.Namespace, None] = None) -> None:
# because it's already been determined based on the prior env var before launching our # 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. # script--`datasets` gets imported by lm_eval internally before these lines can update the env.
import datasets import datasets
from packaging.version import parse as vparse
datasets.config.HF_DATASETS_TRUST_REMOTE_CODE = True if vparse(datasets.__version__) < vparse("4.0.0"):
datasets.config.HF_DATASETS_TRUST_REMOTE_CODE = True
if isinstance(args.model_args, dict): if isinstance(args.model_args, dict):
args.model_args["trust_remote_code"] = True args.model_args["trust_remote_code"] = True
......
...@@ -981,6 +981,10 @@ class ConfigurableTask(Task): ...@@ -981,6 +981,10 @@ class ConfigurableTask(Task):
def download( def download(
self, dataset_kwargs: Optional[Dict[str, Any]] = None, **kwargs self, dataset_kwargs: Optional[Dict[str, Any]] = None, **kwargs
) -> None: ) -> None:
from packaging.version import parse as vparse
if dataset_kwargs and vparse(datasets.__version__) >= vparse("4.0.0"):
dataset_kwargs.pop("trust_remote_code", None)
if isinstance(self.config.custom_dataset, Callable): if isinstance(self.config.custom_dataset, Callable):
eval_logger.warning( eval_logger.warning(
f"{self.config.task}: Custom kwargs can be passed to `--metadata` in console (as json string) or to the TaskManager." f"{self.config.task}: Custom kwargs can be passed to `--metadata` in console (as json string) or to the TaskManager."
......
This diff is collapsed.
tag: tag:
- multiple_choice - multiple_choice
task: hellaswag task: hellaswag
dataset_path: hellaswag dataset_path: Rowan/hellaswag
dataset_name: null dataset_name: null
output_type: multiple_choice output_type: multiple_choice
training_split: train training_split: train
......
...@@ -21,7 +21,7 @@ license = { "text" = "MIT" } ...@@ -21,7 +21,7 @@ license = { "text" = "MIT" }
dependencies = [ dependencies = [
"accelerate>=0.26.0", "accelerate>=0.26.0",
"evaluate", "evaluate",
"datasets>=2.16.0", "datasets>=2.16.0,<4.0",
"evaluate>=0.4.0", "evaluate>=0.4.0",
"jsonlines", "jsonlines",
"numexpr", "numexpr",
......
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