

TITLE
Configuration initialized from checkpoint does not keep the checkpoint identifier in its attributes

COMMENTS
3

REACTIONS
+1: 0
-1: 0
laugh: 0
hooray: 0
heart: 0
rocket: 0
eyes: 0

BODY
Since version v3.4.0, initializing a model using the `from_pretrained` method adds a `name_or_path` attribute to the configuration, referencing the checkpoint used for initialization:

```py
from transformers import BertModel

model = BertModel.from_pretrained(model_name)
print(model.config.name_or_path)
# model_name
```

However, initializing the configuration on its own with the `from_pretrained` method does not yield the same attribute:

```py
from transformers import BertConfig

config = BertConfig.from_pretrained(model_name)
# config has no `name_or_path` attribute
```

This means that the configuration object initialized is not the same in both cases, whereas it probably should be.