Problems when importing ml models with eland_import_hub_model

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

$ 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:

    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 (and so, importing a different model)

 $ 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:

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

Some tips?

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