# How to load an AutoNLP model

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-load-an-autonlp-model%2F19846%3E%5C
**Category:** 🤗AutoTrain\
**Created:** [June 30, 2022, 12:24pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-load-an-autonlp-model%2F19846 "2022-06-30T12:24:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Antoine326](https://avatars.discourse-cdn.com/v4/letter/a/71e660/32.png) [@Antoine326](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FAntoine326)%5C
**Post date:** [June 30, 2022, 12:24pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-load-an-autonlp-model%2F19846%2F1 "2022-06-30T12:24:33Z")

</div>

Hello,

I am trying to load an autoNLP model but having an issue.  
I tried loading it in a pipeline, in this way:

```auto
model = pipeline("text2text-generation", model=“PATH”)

```

but I am getting the following error.

ValueError: Could not load model with any of the following classes: (\<class ‘transformers.models.auto.modeling\_auto.AutoModelForSeq2SeqLM’\>, \<class ‘transformers.models.auto.modeling\_tf\_auto.TFAutoModelForSeq2SeqLM’\>, \<class ‘transformers.models.mt5.modeling\_mt5.MT5ForConditionalGeneration’\>, \<class ‘transformers.models.mt5.modeling\_tf\_mt5.TFMT5ForConditionalGeneration’\>).

Is it actually possible to use the pipeline function if the model is not public?

Thanks,

Antoine

---

<div class="post-metadata">

**Author:** ![abhishek](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/abhishek/32/32360_2.png) [@abhishek](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fabhishek)%5C
**Post date:** [June 30, 2022, 12:44pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-load-an-autonlp-model%2F19846%2F2 "2022-06-30T12:44:38Z")

</div>

yes you can use private models if you use the `use_auth_token` argument.  
More:

```auto
use_auth_token (str or bool, optional) — The token to use as HTTP bearer authorization for remote files. If True, will use the token generated when running transformers-cli login (stored in ~/.huggingface). model_kwargs — Additional dictionary of keyword arguments passed along to the model’s from_pretrained(..., **model_kwargs) function. kwargs — Additional keyword arguments passed along to the specific pipeline init (see the documentation for the corresponding pipeline class for possible values).

```
