bug: TypeError('must be called with a dataclass type or instance') from None

#2
by zhhao - opened

File "/usr/local/lib/python3.12/dist-packages/datasets/features/features.py", line 1750, in from_dict
obj = generate_from_dict(dic)
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/datasets/features/features.py", line 1392, in generate_from_dict
return {key: generate_from_dict(value) for key, value in obj.items()}
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/datasets/features/features.py", line 1403, in generate_from_dict
field_names = {f.name for f in fields(class_type)}
^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/dataclasses.py", line 1282, in fields
raise TypeError('must be called with a dataclass type or instance') from None

solved: pip install datasets==4.0.0

Sign up or log in to comment