# Problems when importing ml models with eland\_import\_hub\_model

**URL:** <https://discuss.elastic.co/t/problems-when-importing-ml-models-with-eland-import-hub-model/302499>\
**Category:** Elasticsearch\
**Created:** [April 15, 2022, 10:24am UTC](https://discuss.elastic.co/t/problems-when-importing-ml-models-with-eland-import-hub-model/302499 "2022-04-15T10:24:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cman](https://avatars.discourse-cdn.com/v4/letter/c/cdc98d/32.png) [@cman](https://discuss.elastic.co/u/cman)\
**Post date:** [April 15, 2022, 10:24am UTC](https://discuss.elastic.co/t/problems-when-importing-ml-models-with-eland-import-hub-model/302499/1 "2022-04-15T10:24:20Z")

</div>

I have got some errors while trying to import a couple of ml models by the command "eland\_import\_hub\_model".

In the one case I would like to import this model: _sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2_

```auto
$ eland_import_hub_model \ 
  --url http://localhost:9200 \ 
  --hub-model-id sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2 \ 
  --task-type text_embedding

```

But I got thi error:

````nohighlight
    main()
  File "/Users/xyz/.pyenv/versions/3.7.3/bin/eland_import_hub_model", line 104, in main
    tm = TransformerModel(args.hub_model_id, args.task_type, args.quantize)
  File "/Users/xyz/.pyenv/versions/3.7.3/lib/python3.7/site-packages/eland/ml/pytorch/transformers.py", line 394, in __init__
    use_fast=False,
  File "/Users/xyz/.pyenv/versions/3.7.3/lib/python3.7/site-packages/transformers/models/auto/tokenization_auto.py", line 549, in from_pretrained
    return tokenizer_class_py.from_pretrained(pretrained_model_name_or_path, *inputs, **kwargs)
  File "/Users/xyz/.pyenv/versions/3.7.3/lib/python3.7/site-packages/transformers/tokenization_utils_base.py", line 1787, in from_pretrained
    **kwargs,
  File "/Users/xyz/.pyenv/versions/3.7.3/lib/python3.7/site-packages/transformers/tokenization_utils_base.py", line 1915, in _from_pretrained
    tokenizer = cls(*init_inputs, **init_kwargs)
  File "/Users/xyz/.pyenv/versions/3.7.3/lib/python3.7/site-packages/transformers/models/bert/tokenization_bert.py", line 193, in __init__
    if not os.path.isfile(vocab_file):
  File "/Users/xyz/.pyenv/versions/3.7.3/lib/python3.7/genericpath.py", line 30, in isfile
    st = os.stat(path)
TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType```

````

The version of Elasticsearch is 7.17  
I've previously installed the following required modules through pip (version 22.0.4): _torchvision_, _transformers, sentence\_transformers_.

Further, if I execute the command as exactly reported in in [documentation](https://www.elastic.co/guide/en/machine-learning/master/ml-nlp-deploy-models.html#ml-nlp-import-model) (and so, importing a different model)

```auto
 $ eland_import_hub_model \ 
  --url http://localhost:9200 \ 
  --hub-model-id elastic/distilbert-base-cased-finetuned-conll03-english \
  --task-type ner

```

it throws this error:

```auto
elasticsearch.BadRequestError: BadRequestError(400, 'x_content_parse_exception', '[1:22] unknown field [ner]')

```

Some tips?

---

<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:** [May 13, 2022, 10:24am UTC](https://discuss.elastic.co/t/problems-when-importing-ml-models-with-eland-import-hub-model/302499/2 "2022-05-13T10:24:56Z")

</div>

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