# Difference between AutoModel and AutoModelForLM

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fdifference-between-automodel-and-automodelforlm%2F5967%3E%5C
**Category:** Beginners\
**Created:** [May 4, 2021, 8:49am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fdifference-between-automodel-and-automodelforlm%2F5967 "2021-05-04T08:49:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tejan-rgb](https://avatars.discourse-cdn.com/v4/letter/t/ecd19e/32.png) [@tejan-rgb](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Ftejan-rgb)%5C
**Post date:** [May 4, 2021, 8:49am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fdifference-between-automodel-and-automodelforlm%2F5967%2F1 "2021-05-04T08:49:22Z")

</div>

What is the difference between downloading a model using `AutoModel.from_pretrained(model_name)` and `AutoModelForLM.from_pretrained(model_name)` ?

---

<div class="post-metadata">

**Author:** ![sgugger](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/sgugger/32/2291_2.png) [@sgugger](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fsgugger)%5C
**Post date:** [May 4, 2021, 12:17pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fdifference-between-automodel-and-automodelforlm%2F5967%2F2 "2021-05-04T12:17:38Z")

</div>

The first one will give you the bare pretrained model, while the second one will have a head attached to do language modeling. Note that `AutoModelForLM` is deprecated, you should use `AutoModelForCausalLM`, `AutoModelForMaskedLM` or `AutoModelForSeq2SeqLM` depending on the task at hand.

---

<div class="post-metadata">

**Author:** ![tejan-rgb](https://avatars.discourse-cdn.com/v4/letter/t/ecd19e/32.png) [@tejan-rgb](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Ftejan-rgb)%5C
**Post date:** [May 4, 2021, 2:38pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fdifference-between-automodel-and-automodelforlm%2F5967%2F3 "2021-05-04T14:38:59Z")

</div>

Thank You.
