# Error on uploading ML model to Elasticsearch

**URL:** <https://discuss.elastic.co/t/error-on-uploading-ml-model-to-elasticsearch/320803>\
**Category:** Elasticsearch\
**Created:** [December 8, 2022, 3:18pm UTC](https://discuss.elastic.co/t/error-on-uploading-ml-model-to-elasticsearch/320803 "2022-12-08T15:18:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Odd\_Erik\_Gronberg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/odd_erik_gronberg/32/52179_2.png) [@Odd\_Erik\_Gronberg](https://discuss.elastic.co/u/Odd_Erik_Gronberg)\
**Post date:** [December 8, 2022, 3:18pm UTC](https://discuss.elastic.co/t/error-on-uploading-ml-model-to-elasticsearch/320803/1 "2022-12-08T15:18:28Z")

</div>

I am trying to upload a ML model to Elasticsearch through the Eland client but there seems to be some issues. The model I am trying to upload is listed as a Compatible third party model in the documentation here:

> **[Compatible third party NLP models | Machine Learning in the Elastic Stack...](https://www.elastic.co/guide/en/machine-learning/current/ml-nlp-model-ref.html)**
>
> The list of compatible third party NLP models.

Model: [sentence-transformers/paraphrase-multilingual-mpnet-base-v2 · Hugging Face](https://huggingface.co/sentence-transformers/paraphrase-multilingual-mpnet-base-v2)

Eland command:  
eland\_import\_hub\_model  
-u elastic  
-p XXXXXXXX  
--cloud-id XXXXXXXX  
--hub-model-id sentence-transformers/paraphrase-multilingual-mpnet-base-v2  
--task-type text\_embedding  
--start

Error message:

```auto
2022-12-08 15:13:57,700 INFO : Loading HuggingFace transformer tokenizer and model 'sentence-transformers/paraphrase-multilingual-mpnet-base-v2'
Traceback (most recent call last):
  File "/usr/local/bin/eland_import_hub_model", line 197, in <module>
    tm = TransformerModel(args.hub_model_id, args.task_type, args.quantize)
  File "/usr/local/lib/python3.9/dist-packages/eland/ml/pytorch/transformers.py", line 547, in __init__
    raise TypeError(
TypeError: Tokenizer type PreTrainedTokenizer(name_or_path='sentence-transformers/paraphrase-multilingual-mpnet-base-v2', vocab_size=250002, model_max_len=512, is_fast=False, padding_side='right', truncation_side='right', special_tokens={'bos_token': '<s>', 'eos_token': '</s>', 'unk_token': '<unk>', 'sep_token': '</s>', 'pad_token': '<pad>', 'cls_token': '<s>', 'mask_token': AddedToken("<mask>", rstrip=False, lstrip=True, single_word=False, normalized=False)}) not supported, must be one of: <class 'transformers.models.bart.tokenization_bart.BartTokenizer'>, <class 'transformers.models.bert.tokenization_bert.BertTokenizer'>, <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'>

```

Any idea's whats causing this? I am able to upload other models from the compatible model list without issues.

Thanks!

---

<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:** [January 5, 2023, 3:19pm UTC](https://discuss.elastic.co/t/error-on-uploading-ml-model-to-elasticsearch/320803/2 "2023-01-05T15:19:10Z")

</div>

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