# Config parameters for custom models

**URL:** <https://discuss.huggingface.co/t/config-parameters-for-custom-models/82934>\
**Category:** 🤗Transformers\
**Created:** [April 21, 2024, 3:35pm UTC](https://discuss.huggingface.co/t/config-parameters-for-custom-models/82934 "2024-04-21T15:35:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![savasci](https://avatars.discourse-cdn.com/v4/letter/s/e9c0ed/32.png) [@savasci](https://discuss.huggingface.co/u/savasci)\
**Post date:** [April 21, 2024, 3:35pm UTC](https://discuss.huggingface.co/t/config-parameters-for-custom-models/82934/1 "2024-04-21T15:35:51Z")

</div>

Hi everyone,

I’ve faced a problem regarding the configuration parameters of a custom model (say distilbert). To elaborate, let’s give an example:  
Suppose we want to perform the text classification task. For this purpose, we have 2 approaches:

1. we can directly use `DistilBertForSequenceClassification` in hugging face modules (and just change the number of output in classifier):  
`model = DistilBertForSequenceClassification.from_pretrained('distilbert-base-uncased')`

2. write a custom model and define a specific classification head:

![soal](https://us1.discourse-cdn.com/hellohellohello/original/3X/7/8/78a1b028351023525501ee8e7584432849514763.png)

In the first approach, `model.config` gives the configuration of the model, but in the second, it rises an error: `'Distilbert' object has no attribute 'config'`.  
The question is, why does this happen?!

Thanks
