xlang-ai / UnifiedSKG

[EMNLP 2022] Unifying and multi-tasking structured knowledge grounding with language models
https://arxiv.org/abs/2201.05966
Apache License 2.0
550 stars 58 forks source link

TypeError: get_hash() missing 1 required positional argument: 'use_fast_tokenizer' #17

Closed puraminy closed 2 years ago

puraminy commented 2 years ago

I generated some predictions for fetaqa task. Then I tried to run its evaluator on the output results (predictions_predict.json). I get the following error for bertscore metric.

File "/home/pouramini/anaconda3/envs/uni/lib/python3.7/site-packages/datasets/metric.py", line 402, in compute
    output = self._compute(predictions=predictions, references=references, **kwargs)
  File "/home/pouramini/.cache/huggingface/modules/datasets_modules/metrics/bertscore/ad3c901af4d4f2c58af08db5c6aae5af2a3668edcf7c8f3fa9419c22807ad482/bertscore.py", line 147, in _compute
    use_custom_baseline=baseline_path is not None,
TypeError: get_hash() missing 1 required positional argument: 'use_fast_tokenizer'

There could be a mismatch between datasets metrics and bertscore, however I tried to install the versions in yaml.

Timothyxxx commented 2 years ago

Hi,

Did you build dependencies as shown in here? It seems a problem caused by huggingface-datasets version.

Hope these information helpful!

Thanks!

puraminy commented 2 years ago

Yes, you didn't specify any version for datasets in the yaml file. Mine is 1.11.0. The bert-score version you specified is 0.3.10 however.

Which version should be used for the datasets?

Timothyxxx commented 2 years ago

Oh I see the problem. Actually we didn't specify the version in yaml file because we want to avoid conflict during conda env create -f py3.7pytorch1.8.yaml(there are so many metrics, datasets and reliance...), and after that command is finished, you need to run pip install datasets==1.14.0 specially to install the datasets v 1.14.0 as we used. Please try that and see if it can solve your problem.

Thanks!

puraminy commented 2 years ago

Thanks, before reading your comment I tried datasets 1.18.3 and the problem was resolved, I will try the version you said

Timothyxxx commented 2 years ago

Okay, feel free to re-open this if you encounter further problem in the future.