-
Notifications
You must be signed in to change notification settings - Fork 19
Closed
Labels
bugSomething isn't workingSomething isn't workingprioritizedHigh priority issue needs attentionHigh priority issue needs attention
Description
Describe the bug
Failure when loading bleu
metric. Probably due to the loose version range dependency on datasets
through evaluate
.
To Reproduce
load_metric("bleu")
Exception Traceback (if available)
AttributeError Traceback (most recent call last)
[<ipython-input-15-2fcc283dab87>](https://localhost:8080/#) in <cell line: 2>()
1 MT_METRICS = [
----> 2 load_metric("bleu", resulting_name="bleu_1", compute_kwargs={"max_order": 1}),
3 load_metric("bleu", resulting_name="bleu_2", compute_kwargs={"max_order": 2}),
4 load_metric("meteor"),
5 load_metric("rouge"),
[/usr/local/lib/python3.9/dist-packages/jury/metrics/_core/auto.py](https://localhost:8080/#) in load_metric(path, resulting_name, task, compute_kwargs, use_jury_only, **kwargs)
---> 55 return AutoMetric.load(
56 path=path,
57 resulting_name=resulting_name,
[/usr/local/lib/python3.9/dist-packages/jury/metrics/_core/auto.py](https://localhost:8080/#) in load(cls, path, task, resulting_name, compute_kwargs, use_jury_only, **kwargs)
114 factory_class = module.__main_class__
115 klass = getattr(module, factory_class)
--> 116 metric = klass.construct(task=task, resulting_name=resulting_name, compute_kwargs=compute_kwargs, **kwargs)
117 return metric
118
[/usr/local/lib/python3.9/dist-packages/jury/metrics/bleu/bleu.py](https://localhost:8080/#) in construct(cls, task, resulting_name, compute_kwargs, **kwargs)
22 subclass = cls._get_subclass()
23 resulting_name = resulting_name or cls._get_path(compute_kwargs=compute_kwargs)
---> 24 return subclass._construct(resulting_name=resulting_name, compute_kwargs=compute_kwargs, **kwargs)
25
26 @classmethod
[/usr/local/lib/python3.9/dist-packages/jury/metrics/_core/base.py](https://localhost:8080/#) in _construct(cls, resulting_name, compute_kwargs, **kwargs)
235 cls, resulting_name: Optional[str] = None, compute_kwargs: Optional[Dict[str, Any]] = None, **kwargs
236 ):
--> 237 return cls(resulting_name=resulting_name, compute_kwargs=compute_kwargs, **kwargs)
238
239 @staticmethod
[/usr/local/lib/python3.9/dist-packages/jury/metrics/bleu/bleu_for_language_generation.py](https://localhost:8080/#) in __init__(self, resulting_name, compute_kwargs, **kwargs)
119 self.should_change_resulting_name = resulting_name is None
120 self.tokenizer = DefaultTokenizer()
--> 121 super().__init__(resulting_name=resulting_name, compute_kwargs=compute_kwargs, **kwargs)
122
123 def _info(self):
[/usr/local/lib/python3.9/dist-packages/jury/metrics/_core/base.py](https://localhost:8080/#) in __init__(self, resulting_name, compute_kwargs, **kwargs)
220 def __init__(self, resulting_name: Optional[str] = None, compute_kwargs: Optional[Dict[str, Any]] = None, **kwargs):
221 compute_kwargs = self._validate_compute_kwargs(compute_kwargs)
--> 222 super().__init__(task=self._task, resulting_name=resulting_name, compute_kwargs=compute_kwargs, **kwargs)
223
224 def _validate_compute_kwargs(self, compute_kwargs: Dict[str, Any]) -> Dict[str, Any]:
[/usr/local/lib/python3.9/dist-packages/jury/metrics/_core/base.py](https://localhost:8080/#) in __init__(self, task, resulting_name, compute_kwargs, config_name, keep_in_memory, cache_dir, num_process, process_id, seed, experiment_id, max_concurrent_cache_files, timeout, **kwargs)
100 self.resulting_name = resulting_name if resulting_name is not None else self.name
101 self.compute_kwargs = compute_kwargs or {}
--> 102 self.download_and_prepare()
103
104 @abstractmethod
[/usr/local/lib/python3.9/dist-packages/evaluate/module.py](https://localhost:8080/#) in download_and_prepare(self, download_config, dl_manager)
649 )
650
--> 651 self._download_and_prepare(dl_manager)
652
653 def _download_and_prepare(self, dl_manager):
[/usr/local/lib/python3.9/dist-packages/jury/metrics/bleu/bleu_for_language_generation.py](https://localhost:8080/#) in _download_and_prepare(self, dl_manager)
150 nmt_source = "https://raw.githubusercontent.com/tensorflow/nmt/0be864257a76c151eef20ea689755f08bc1faf4e/nmt/scripts/bleu.py"
--> 151 self.external_module_path = dl_manager.download(nmt_source)
152
153 def _preprocess(self, predictions: Collator, references: Collator) -> Tuple[Collator, Collator]:
[/usr/local/lib/python3.9/dist-packages/datasets/download/download_manager.py](https://localhost:8080/#) in download(self, url_or_urls)
425
426 start_time = datetime.now()
--> 427 downloaded_path_or_paths = map_nested(
428 download_func,
429 url_or_urls,
[/usr/local/lib/python3.9/dist-packages/datasets/utils/py_utils.py](https://localhost:8080/#) in map_nested(function, data_struct, dict_only, map_list, map_tuple, map_numpy, num_proc, parallel_min_length, types, disable_tqdm, desc)
433 # Singleton
434 if not isinstance(data_struct, dict) and not isinstance(data_struct, types):
--> 435 return function(data_struct)
436
437 disable_tqdm = disable_tqdm or not logging.is_progress_bar_enabled()
[/usr/local/lib/python3.9/dist-packages/datasets/download/download_manager.py](https://localhost:8080/#) in _download(self, url_or_filename, download_config)
451 # append the relative path to the base_path
452 url_or_filename = url_or_path_join(self._base_path, url_or_filename)
--> 453 return cached_path(url_or_filename, download_config=download_config)
454
455 def iter_archive(self, path_or_buf: Union[str, io.BufferedReader]):
[/usr/local/lib/python3.9/dist-packages/datasets/utils/file_utils.py](https://localhost:8080/#) in cached_path(url_or_filename, download_config, **download_kwargs)
193 use_auth_token=download_config.use_auth_token,
194 ignore_url_params=download_config.ignore_url_params,
--> 195 storage_options=download_config.storage_options,
196 download_desc=download_config.download_desc,
197 )
AttributeError: 'DownloadConfig' object has no attribute 'storage_options'
Environment Information:
- OS: Linux 5.10.147+
- jury version: 2.2.3
- evaluate version: 0.2.2
- datasets version: 2.11.0
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingprioritizedHigh priority issue needs attentionHigh priority issue needs attention