I am trying to upload ML Model into elasticsearch using the eland script provided in the documentation.
Installed Python, eland & Pytorch but still unable to upload.
python version : Python 3.7.9
Eland version : 8.3.0
torch version : 1.11.0
Below is the script i am executing eland_import_hub_model --url http://localhost:9200/ --hub-model-id openai/clip-vit-large-patch14 --task-type ner --start
But facing this error 'eland_import_hub_model' is not recognized as an internal or external command,operable program or batch file.
Hey @ksaimohan2k glad to hear you're interested in uploading models with eland! It sounds like the installed eland and eland_import_hub_model script is not being found on you system. Are you on Windows or macOS or Linux? I'd recommend trying out the Docker approach as well, as it's a bit more reliable across various operating systems.
Hi @joshdevins even in docker i am facing the same issue i am able to see in folders within path that eland_import_hub_model existed but when i am execuitng the command facing the error
C:\Users\SaiMohan\eland\bin>docker run -it --rm --network host eland_import_hub_model --url http://localhost:9200/ --hub-model-id openai/clip-vit-large-patch14 --task-type ner --start
Unable to find image 'eland_import_hub_model:latest' locally
docker: Error response from daemon: pull access denied for eland_import_hub_model, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
Hey @ksaimohan2k I'm sorry for the difficulties you're facing. We acknowledge that the current process is a bit complicated and are working hard to improve the tools for model upload.
I believe the original problem you are encountering might be due to a known bug we have with eland on Windows. If you subscribe to that GitHub issue, you will get notifications about fixes.
For Docker, you have to make sure you build the container first:
Yes, the build was successful. Sorry if I am wasting your time; I am a bit new to all this and am trying to catch up. Thank You for spending your valuable time.
I cloned the using git git clone git@github.com:elastic/eland.git
The i executed the command for build
cd /path-to-repository/eland
docker build -t elastic/eland .
After this I am getting little confused about below command like where to run it within cmd because running the container I am getting # prompt where I am facing issue.
$ docker run -it --rm --network host \
elastic/eland \
eland_import_hub_model \
--url http://host.docker.internal:9200/ \
--hub-model-id elastic/distilbert-base-cased-finetuned-conll03-english \
--task-type ner
Hey @joshdevins I am running that command in directory where I cloned eland.
Sorry if my syntax is bad I am new to docker. I am attaching below error for the reference.
I think in Windows you have to remove the \ that are separating lines in the Linux/macOS examples. If it's a Docker problem, then I'm afraid it'll be hard for me to debug remotely. I'd look around for the error string on Google and in Docker forums to see if you can get the container running.
Yeah that trailing \r appears to be the problem. This looks like a Windows/Linux incompatibility for some reason in the script. This is a bit odd as the script in git doesn't have that trailing \r character. I'm not sure how to explain how this ended up. I know this works on macOS and Linux, do you possibly have access to a different machine to run this command from?
I think you might have to otherwise wait until this other bug is fixed.
Happy to help. Unfortunately for now, you must use eland for uploads as it also prepares the model to be used in Elasticsearch and this can't be done in any other tool for now.
We definitely recognise the difficulties with eland so we hope to also have alternative model upload tools in the future.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.