# What does model.config.num\_hidden\_layers do?

**URL:** <https://discuss.huggingface.co/t/what-does-model-config-num-hidden-layers-do/5952>\
**Category:** Beginners\
**Created:** [May 3, 2021, 11:37am UTC](https://discuss.huggingface.co/t/what-does-model-config-num-hidden-layers-do/5952 "2021-05-03T11:37:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![theudster](https://avatars.discourse-cdn.com/v4/letter/t/97f17d/32.png) [@theudster](https://discuss.huggingface.co/u/theudster)\
**Post date:** [May 3, 2021, 11:37am UTC](https://discuss.huggingface.co/t/what-does-model-config-num-hidden-layers-do/5952/1 "2021-05-03T11:37:39Z")

</div>

Following my question on how to [delete layers from a finetuned LM](https://discuss.huggingface.co/t/how-can-you-delete-bert-layers-after-finetuning/5885), I came across a [Github](https://github.com/hsajjad/transformers/blob/master/examples/run_glue.py) that on first glance seem to do that (see from line 580).

They use

`model.config.num_hidden_layers`

when defining their model for training  
I am not sure what this does though? if I specify this to 10 after loading a finetuned model, will I only be using the first 10 layers?

More specifically, I loaded a finetuned model for qa as such:

```
from transformers import AutoTokenizer, AutoModelForQuestionAnswering  

model_name = 'twmkn9/bert-base-uncased-squad2'

tokenizer = AutoTokenizer.from_pretrained(model_name)  
model = AutoModelForQuestionAnswering.from_pretrained(model_name)

```

and then

```
model.config.num_hidden_layers = 10

```

Does that mean that I only have the last layer on now?  
Do I need to add a layer to process the output so that I can get the SQuAD output?  
Thank you
