# Error loading model to ElasticSearch

**URL:** <https://discuss.elastic.co/t/error-loading-model-to-elasticsearch/344818>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-machine-learning, docker\
**Created:** [October 11, 2023, 12:24pm UTC](https://discuss.elastic.co/t/error-loading-model-to-elasticsearch/344818 "2023-10-11T12:24:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![RodAndTom](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rodandtom/32/126553_2.png) [@RodAndTom](https://discuss.elastic.co/u/RodAndTom)\
**Post date:** [October 11, 2023, 12:24pm UTC](https://discuss.elastic.co/t/error-loading-model-to-elasticsearch/344818/1 "2023-10-11T12:24:09Z")

</div>

Hi,

I previously successfully uploaded a NER model from Huggingface to Elasticsearch (8.10) with Eland.  
Now I'm trying to load a Text Classification and I'm getting an error:

docker run -it --rm --network host   
[docker.elastic.co/eland/eland](http://docker.elastic.co/eland/eland)   
eland\_import\_hub\_model   
--url my elastic host and port/   
--hub-model-id MoritzLaurer/mDeBERTa-v3-base-xnli-multilingual-nli-2mil7   
--task-type zero\_shot\_classification   
--clear-previous

The exception I'm getting:

```auto
Traceback (most recent call last):
  File "/usr/local/bin/eland_import_hub_model", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.9/dist-packages/eland/cli/eland_import_hub_model.py", line 235, in main
    tm = TransformerModel(
  File "/usr/local/lib/python3.9/dist-packages/eland/ml/pytorch/transformers.py", line 624, in __init__
    raise TypeError(
TypeError: Tokenizer type PreTrainedTokenizer(name_or_path='sileod/mdeberta-v3-base-tasksource-nli', vocab_size=250101, model_max_len=1000000000000000019884624838656, is_fast=False, padding_side='right', truncation_side='right', special_tokens={'bos_token': '[CLS]', 'eos_token': '[SEP]', 'unk_token': '[UNK]', 'sep_token': '[SEP]', 'pad_token': '[PAD]', 'cls_token': '[CLS]', 'mask_token': '[MASK]'}) not supported, must be one of: <class 'transformers.models.bart.tokenization_bart.BartTokenizer'>, <class 'transformers.models.bert.tokenization_bert.BertTokenizer'>, <class 'transformers.models.bert_japanese.tokenization_bert_japanese.BertJapaneseTokenizer'>, <class 'transformers.models.distilbert.tokenization_distilbert.DistilBertTokenizer'>, <class 'transformers.models.dpr.tokenization_dpr.DPRContextEncoderTokenizer'>, <class 'transformers.models.dpr.tokenization_dpr.DPRQuestionEncoderTokenizer'>, <class 'transformers.models.electra.tokenization_electra.ElectraTokenizer'>, <class 'transformers.models.mobilebert.tokenization_mobilebert.MobileBertTokenizer'>, <class 'transformers.models.mpnet.tokenization_mpnet.MPNetTokenizer'>, <class 'transformers.models.retribert.tokenization_retribert.RetriBertTokenizer'>, <class 'transformers.models.roberta.tokenization_roberta.RobertaTokenizer'>, <class 'transformers.models.squeezebert.tokenization_squeezebert.SqueezeBertTokenizer'>, <class 'transformers.models.xlm_roberta.tokenization_xlm_roberta.XLMRobertaTokenizer'>

```

Does anyone have any clues?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![iulia](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/iulia/32/124658_2.png) [@iulia](https://discuss.elastic.co/u/iulia)\
**Post date:** [October 11, 2023, 1:08pm UTC](https://discuss.elastic.co/t/error-loading-model-to-elasticsearch/344818/2 "2023-10-11T13:08:45Z")

</div>

Hi Rodrigo!  
Welcome to the community!

The error message says that the particular model you are trying to import is not yet implemented for Eland. You can see the list of supported third party models here: [Compatible third party NLP models | Machine Learning in the Elastic Stack [8.10] | Elastic](https://www.elastic.co/guide/en/machine-learning/current/ml-nlp-model-ref.html)  
Currently, these are listed for text classification:

Third party text classification models

- [BERT base uncased emotion](https://huggingface.co/nateraw/bert-base-uncased-emotion)
- [DehateBERT mono english](https://huggingface.co/Hate-speech-CNERG/dehatebert-mono-english)
- [DistilBERT base uncased emotion](https://huggingface.co/bhadresh-savani/distilbert-base-uncased-emotion)
- [DistilBERT base uncased finetuned SST-2](https://huggingface.co/distilbert-base-uncased-finetuned-sst-2-english)
- [FinBERT](https://huggingface.co/ProsusAI/finbert)
- [Twitter roBERTa base for Sentiment Analysis](https://huggingface.co/cardiffnlp/twitter-roberta-base-sentiment)

Perhaps one of these would also work for the use case you have in mind, then it would be easiest to implement with the code you already have set up.  
Hope this helps!

Cheers,  
Iulia

---

<div class="post-metadata">

**Author:** ![RodAndTom](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rodandtom/32/126553_2.png) [@RodAndTom](https://discuss.elastic.co/u/RodAndTom)\
**Post date:** [October 11, 2023, 1:14pm UTC](https://discuss.elastic.co/t/error-loading-model-to-elasticsearch/344818/3 "2023-10-11T13:14:04Z")

</div>

Hi Iulia. Thank you very much.

---

<div class="post-metadata">

**Author:** ![iulia](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/iulia/32/124658_2.png) [@iulia](https://discuss.elastic.co/u/iulia)\
**Post date:** [October 11, 2023, 4:10pm UTC](https://discuss.elastic.co/t/error-loading-model-to-elasticsearch/344818/4 "2023-10-11T16:10:39Z")

</div>

You're welcome! Good luck with the project 🙂

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 8, 2023, 4:10pm UTC](https://discuss.elastic.co/t/error-loading-model-to-elasticsearch/344818/5 "2023-11-08T16:10:58Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
