# "ValueError: Unrecognized model type" when loading my trained custom model

**URL:** <https://discuss.huggingface.co/t/valueerror-unrecognized-model-type-when-loading-my-trained-custom-model/100570>\
**Category:** 🤗Transformers\
**Created:** [August 2, 2024, 10:36am UTC](https://discuss.huggingface.co/t/valueerror-unrecognized-model-type-when-loading-my-trained-custom-model/100570 "2024-08-02T10:36:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![LujainAbdulrahman](https://avatars.discourse-cdn.com/v4/letter/l/3bc359/32.png) [@LujainAbdulrahman](https://discuss.huggingface.co/u/LujainAbdulrahman)\
**Post date:** [August 2, 2024, 10:36am UTC](https://discuss.huggingface.co/t/valueerror-unrecognized-model-type-when-loading-my-trained-custom-model/100570/1 "2024-08-02T10:36:52Z")

</div>

Hello everyone,  
I have trained a transformer model as a sequence-to-sequence model, did not finetune an LLM.

However, my way of saving the model into huggingface or even locally seems to be incorrect, meaning that checkpoints, weights and other important model configurations may have not been saved properly.

because when I try to load it from huggingface, it gives me this error:

ValueError: Unrecognized model in Lu… Should have a model\_type key in its config.json, or contain one of the following strings in its name: albert, align, altclip…

Please find the layout of my work in this notebook:

> **[Google Colab](https://colab.research.google.com/drive/1qwT4mqaTPoVW7HwlWNRKheR7FAzIdR-L#scrollTo=DtU3whBevE31)**

---

<div class="post-metadata">

**Author:** ![Toasteror](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@Toasteror](https://discuss.huggingface.co/u/Toasteror)\
**Post date:** [August 12, 2024, 9:58am UTC](https://discuss.huggingface.co/t/valueerror-unrecognized-model-type-when-loading-my-trained-custom-model/100570/2 "2024-08-12T09:58:32Z")

</div>

Hi, I have the same problem, is it resolved?

---

<div class="post-metadata">

**Author:** ![Toasteror](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@Toasteror](https://discuss.huggingface.co/u/Toasteror)\
**Post date:** [August 12, 2024, 10:02am UTC](https://discuss.huggingface.co/t/valueerror-unrecognized-model-type-when-loading-my-trained-custom-model/100570/3 "2024-08-12T10:02:13Z")

</div>

I tried this: [Building custom models](https://huggingface.co/docs/transformers/en/custom_models#building-custom-models)

Didn’t understand the docs

---

<div class="post-metadata">

**Author:** ![LujainAbdulrahman](https://avatars.discourse-cdn.com/v4/letter/l/3bc359/32.png) [@LujainAbdulrahman](https://discuss.huggingface.co/u/LujainAbdulrahman)\
**Post date:** [August 13, 2024, 10:02am UTC](https://discuss.huggingface.co/t/valueerror-unrecognized-model-type-when-loading-my-trained-custom-model/100570/4 "2024-08-13T10:02:40Z")

</div>

No, not yet.
