# How to create a config.json after saving a model

**URL:** <https://discuss.huggingface.co/t/how-to-create-a-config-json-after-saving-a-model/10459>\
**Category:** 🤗Transformers\
**Created:** [October 2, 2021, 12:02pm UTC](https://discuss.huggingface.co/t/how-to-create-a-config-json-after-saving-a-model/10459 "2021-10-02T12:02:42Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![BramVanroy](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/bramvanroy/32/47360_2.png) [@BramVanroy](https://discuss.huggingface.co/u/BramVanroy)\
**Post date:** [October 4, 2021, 9:51am UTC](https://discuss.huggingface.co/t/how-to-create-a-config-json-after-saving-a-model/10459/4 "2021-10-04T09:51:28Z")

</div>

You need to subclass it to have the save\_pretrained methods available. So instead of

```auto
class Mean_Pooling_Model(nn.Module):

```

use

```auto
from transformers.modeling_utils import PreTrainedModel
class Mean_Pooling_Model(PreTrainedModel):

```

It will add extra functionality on top of `nn.Module`.

> <https://github.com/huggingface/transformers/blob/bcc3f7b6560c1ed427f051107c7755956a27a9f2/src/transformers/modeling_utils.py#L415>

---

_[View the full topic](https://discuss.huggingface.co/t/how-to-create-a-config-json-after-saving-a-model/10459)._
