# Download model without the trained weights

**URL:** <https://discuss.huggingface.co/t/download-model-without-the-trained-weights/7613>\
**Category:** Beginners\
**Created:** [June 29, 2021, 9:41am UTC](https://discuss.huggingface.co/t/download-model-without-the-trained-weights/7613 "2021-06-29T09:41:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ahmedoumar](https://avatars.discourse-cdn.com/v4/letter/a/22d042/32.png) [@ahmedoumar](https://discuss.huggingface.co/u/ahmedoumar)\
**Post date:** [June 29, 2021, 9:41am UTC](https://discuss.huggingface.co/t/download-model-without-the-trained-weights/7613/1 "2021-06-29T09:41:27Z")

</div>

Hey community, i hope you’re doing fine.  
I’m new to the huggingface framework, so my question is if there any way to download hugging face models(like bert…) without it’s pretrained weights? the architecture only? i’m using pytorch

Thank you so much.

---

<div class="post-metadata">

**Author:** ![Neel-Gupta](https://avatars.discourse-cdn.com/v4/letter/n/f1d935/32.png) [@Neel-Gupta](https://discuss.huggingface.co/u/Neel-Gupta)\
**Post date:** [June 29, 2021, 10:58am UTC](https://discuss.huggingface.co/t/download-model-without-the-trained-weights/7613/2 "2021-06-29T10:58:26Z")

</div>

you can construct one using your own defined configuration.

```auto
from transformers import BertForMaskedLM

model = BertForMaskedLM(config=config)

```

where in the config variable, you provide the parameters of the model - the no. of heads for attention, FCN size etc.

So you can train from scratch, but you won’t need to download its pre-trained weights and use BERT however you wish.

---

<div class="post-metadata">

**Author:** ![sanders](https://avatars.discourse-cdn.com/v4/letter/s/bc79bd/32.png) [@sanders](https://discuss.huggingface.co/u/sanders)\
**Post date:** [June 30, 2021, 3:02pm UTC](https://discuss.huggingface.co/t/download-model-without-the-trained-weights/7613/3 "2021-06-30T15:02:39Z")

</div>

@Neel-Gupta is there a good hello world doing that?

---

<div class="post-metadata">

**Author:** ![ahmedoumar](https://avatars.discourse-cdn.com/v4/letter/a/22d042/32.png) [@ahmedoumar](https://discuss.huggingface.co/u/ahmedoumar)\
**Post date:** [July 3, 2021, 11:53am UTC](https://discuss.huggingface.co/t/download-model-without-the-trained-weights/7613/4 "2021-07-03T11:53:33Z")

</div>

@Neel-Gupta thank you so much.
