Issue when running the python scripts after cloning the repository

#530
by techboi222 - opened

@clefourrier sorry to bother you, but do you know how to resolve the following error ?


ValueError Traceback (most recent call last)
Cell In[2], line 11
8 from huggingface_hub import HfApi, snapshot_download
10 from src.submission.check_validity import get_model_size
---> 11 from src.display.utils import ModelType, WeightType
13 EVAL_REQUESTS_PATH = "eval-queue"
14 QUEUE_REPO = "open-llm-leaderboard/requests"

File ~\Documents\GitHub\open_llm_leaderboard\src\display\utils.py:61
58 auto_eval_column_dict.append(["dummy", ColumnContent, ColumnContent("model_name_for_query", "str", False, dummy=True)])
60 # We use make dataclass to dynamically fill the scores from Tasks
---> 61 AutoEvalColumn = make_dataclass("AutoEvalColumn", auto_eval_column_dict, frozen=True)
63 @dataclass(frozen=True)
64 class EvalQueueColumn: # Queue column
65 model = ColumnContent("model", "markdown", True)

File ~\AppData\Local\Programs\Python\Python312\Lib\dataclasses.py:1525, in make_dataclass(cls_name, fields, bases, namespace, init, repr, eq, order, unsafe_hash, frozen, match_args, kw_only, slots, weakref_slot, module)
1522 cls.module = module
1524 # Apply the normal decorator.
-> 1525 return dataclass(cls, init=init, repr=repr, eq=eq, order=order,
1526 unsafe_hash=unsafe_hash, frozen=frozen,
1527 match_args=match_args, kw_only=kw_only, slots=slots,
1528 weakref_slot=weakref_slot)

File ~\AppData\Local\Programs\Python\Python312\Lib\dataclasses.py:1266, in dataclass(cls, init, repr, eq, order, unsafe_hash, frozen, match_args, kw_only, slots, weakref_slot)
1263 return wrap
1265 # We're called as @dataclass without parens.
-> 1266 return wrap(cls)

File ~\AppData\Local\Programs\Python\Python312\Lib\dataclasses.py:1256, in dataclass..wrap(cls)
1255 def wrap(cls):
-> 1256 return _process_class(cls, init, repr, eq, order, unsafe_hash,
1257 frozen, match_args, kw_only, slots,
1258 weakref_slot)

File ~\AppData\Local\Programs\Python\Python312\Lib\dataclasses.py:994, in _process_class(cls, init, repr, eq, order, unsafe_hash, frozen, match_args, kw_only, slots, weakref_slot)
991 kw_only = True
992 else:
993 # Otherwise it's a field of some type.
--> 994 cls_fields.append(_get_field(cls, name, type, kw_only))
996 for f in cls_fields:
997 fields[f.name] = f

File ~\AppData\Local\Programs\Python\Python312\Lib\dataclasses.py:852, in _get_field(cls, a_name, a_type, default_kw_only)
848 # For real fields, disallow mutable defaults. Use unhashable as a proxy
849 # indicator for mutability. Read the hash attribute from the class,
850 # not the instance.
851 if f._field_type is _FIELD and f.default.class.hash is None:
--> 852 raise ValueError(f'mutable default {type(f.default)} for field '
853 f'{f.name} is not allowed: use default_factory')
855 return f

ValueError: mutable default <class 'src.display.utils.ColumnContent'> for field model_type_symbol is not allowed: use default_factory

Open LLM Leaderboard org

Hi!
I have no idea, I suspect it a versionning problem - what are you trying to do?

Open LLM Leaderboard org

Closing for inactivity

clefourrier changed discussion status to closed

I guess it works in Python 3.10, but not in Python 3.11.

Sign up or log in to comment