# Load fine-tuned LM without the head?

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fload-fine-tuned-lm-without-the-head%2F14997%3E%5C
**Category:** Beginners\
**Created:** [February 21, 2022, 8:53pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fload-fine-tuned-lm-without-the-head%2F14997 "2022-02-21T20:53:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dhruvmetha](https://avatars.discourse-cdn.com/v4/letter/d/779978/32.png) [@dhruvmetha](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fdhruvmetha)%5C
**Post date:** [February 21, 2022, 8:53pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fload-fine-tuned-lm-without-the-head%2F14997%2F1 "2022-02-21T20:53:22Z")

</div>

Is there a way to load a fine-tuned model without the head? I just need the fine-tuned LM, without the head to use it in another context – I mean the task head.

I used the Trainer API, with a predefined AutoModelFor\*.

---

<div class="post-metadata">

**Author:** ![beneyal](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/beneyal/32/27988_2.png) [@beneyal](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fbeneyal)%5C
**Post date:** [February 22, 2022, 2:11am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fload-fine-tuned-lm-without-the-head%2F14997%2F2 "2022-02-22T02:11:54Z")

</div>

Hi 🙂

Every model that inherits `PreTrainedModel` has a `base_model` property. For example, if you have a `BertForSequenceClassification` model named `model`, then `model.base_model` will give you a `BertModel`, which is exactly `BertForSequenceClassification` minus the classification layer at the end.

---

<div class="post-metadata">

**Author:** ![dhruvmetha](https://avatars.discourse-cdn.com/v4/letter/d/779978/32.png) [@dhruvmetha](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fdhruvmetha)%5C
**Post date:** [February 22, 2022, 1:05pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fload-fine-tuned-lm-without-the-head%2F14997%2F3 "2022-02-22T13:05:45Z")

</div>

Thank you @beneyal
