elastic / eland

Python Client and Toolkit for DataFrames, Big Data, Machine Learning and ETL in Elasticsearch
https://eland.readthedocs.io
Apache License 2.0
635 stars 98 forks source link

Error measuring embedding size for some DPR models #573

Closed davidkyle closed 11 months ago

davidkyle commented 1 year ago

Installing the ance-dpr-context-multi model with the eland_import_hub_model script fails.

eland_import_hub_model       
    --url 'http://localhost:9200'             
    --hub-model-id 'ance-dpr-context-multi'
    --task-type text_embedding 

The error is due to unpacking a tuple that contains a single element.

python3.10/site-packages/eland/ml/pytorch/transformers.py", line 735, in _create_config
    text_embedding, _ = sample_embedding
ValueError: not enough values to unpack (expected 2, got 1)

The fix is to only take the first element

davidkyle commented 1 year ago

buildkite test this