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

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-create-a-config-json-after-saving-a-model%2F10459%3E%5C
**Category:** 🤗Transformers\
**Created:** [October 2, 2021, 12:02pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-create-a-config-json-after-saving-a-model%2F10459 "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](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FBramVanroy)%5C
**Post date:** [October 4, 2021, 9:51am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-create-a-config-json-after-saving-a-model%2F10459%2F4 "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](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-create-a-config-json-after-saving-a-model%2F10459)._
