Closed joeyism closed 2 years ago
I was able to reproduce this pythonically on python 3.8.8
from collections import OrderedDict
from dataclasses import dataclass
class A(OrderedDict):
def __post_init__(self):
self["a"] = 1
@dataclass
class B(A):
some_val = None
b = B()
(A would be ModelOutput
in this case, and B would be BaseModelOutput
)
which throws the same error
AttributeError: 'B' object has no attribute '_OrderedDict__map'
I updated the python version to 3.8.13
and it worked
- `transformers` version: 4.8.2
- Platform: Linux-5.4.0-109-generic-x86_64-with-glibc2.27
- Python version: 3.8.13
- PyTorch version (GPU?): 1.10.1+cu102 (False)
- Tensorflow version (GPU?): 2.5.0 (False)
- Flax version (CPU?/GPU?/TPU?): not installed (NA)
- Jax version: not installed
- JaxLib version: not installed
- Using GPU in script?: No
- Using distributed or parallel set-up in script?: No
System Info
Who can help?
@patrickvonplaten, @anton-l
Information
Tasks
examples
folder (such as GLUE/SQuAD, ...)Reproduction
Here is the code
which is taken from the official documentation
Expected behavior