danieldeutsch / sacrerouge

SacreROUGE is a library dedicated to the use and development of text generation evaluation metrics with an emphasis on summarization.
Apache License 2.0
134 stars 11 forks source link

AttributeError: readonly attribute when trying to do - sacrerouge setup-metric rouge #136

Open Sriharsha-hatwar opened 1 year ago

Sriharsha-hatwar commented 1 year ago

More information :

Traceback (most recent call last):
  File "/Users/sriharshahatwar/miniconda3/envs/bylineextraction/bin/sacrerouge", line 8, in <module>
    sys.exit(main())
  File "/Users/sriharshahatwar/miniconda3/envs/bylineextraction/lib/python3.10/site-packages/sacrerouge/__main__.py", line 5, in main
    parser = build_argument_parser()
  File "/Users/sriharshahatwar/miniconda3/envs/bylineextraction/lib/python3.10/site-packages/sacrerouge/arguments.py", line 10, in build_argument_parser
    import_module_and_submodules('sacrerouge')
  File "/Users/sriharshahatwar/miniconda3/envs/bylineextraction/lib/python3.10/site-packages/sacrerouge/common/util.py", line 102, in import_module_and_submodules
    for module_finder, name, _ in pkgutil.walk_packages(path):
  File "/Users/sriharshahatwar/miniconda3/envs/bylineextraction/lib/python3.10/pkgutil.py", line 92, in walk_packages
    __import__(info.name)
  File "/Users/sriharshahatwar/miniconda3/envs/bylineextraction/lib/python3.10/site-packages/datasets/__init__.py", line 33, in <module>
    from .arrow_dataset import Dataset, concatenate_datasets
  File "/Users/sriharshahatwar/miniconda3/envs/bylineextraction/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 45, in <module>
    from .arrow_reader import ArrowReader
  File "/Users/sriharshahatwar/miniconda3/envs/bylineextraction/lib/python3.10/site-packages/datasets/arrow_reader.py", line 33, in <module>
    from .table import InMemoryTable, MemoryMappedTable, Table, concat_tables
  File "/Users/sriharshahatwar/miniconda3/envs/bylineextraction/lib/python3.10/site-packages/datasets/table.py", line 327, in <module>
    class InMemoryTable(TableBlock):
  File "/Users/sriharshahatwar/miniconda3/envs/bylineextraction/lib/python3.10/site-packages/datasets/table.py", line 354, in InMemoryTable
    def from_pandas(cls, *args, **kwargs):
  File "/Users/sriharshahatwar/miniconda3/envs/bylineextraction/lib/python3.10/site-packages/datasets/table.py", line 21, in wrapper
    out = wraps(arrow_table_method)(method)
  File "/Users/sriharshahatwar/miniconda3/envs/bylineextraction/lib/python3.10/functools.py", line 61, in update_wrapper
    wrapper.__wrapped__ = wrapped
AttributeError: readonly attribute

OS : Mac OS Monterey.

achouhan93 commented 1 year ago

Experiencing the same Attribute Error while executing sacrerouge setup-metric rouge on Google Colab

graceebc9 commented 1 year ago

Experiencing same error, on GCP VM

m0re4u commented 1 year ago

This is probably due to a versioning issue in python3.10, sacrerouge's dependency on repro, and its dependency on datasets. I've made a pull request to fix the issue, but the best local fix is to simply install datasets>=1.16.1 .