openvinotoolkit / openvino_tokenizers

OpenVINO Tokenizers extension
Apache License 2.0
16 stars 13 forks source link

Runtime Error:Error loading libopenvino_tokenizers.so #177

Open bsq1989 opened 3 weeks ago

bsq1989 commented 3 weeks ago

Context

Environment: Docker image: openvino/ubuntu22_runtime Description: when i try to convert huggingface token to openvino token IR , i enconter the error, and do not know which lib is missing for this container. Error info: Cannot load library '/home/openvino/.local/lib/python3.10/site-packages/openvino_tokenizers/lib/libopenvino_tokenizers.so': /home/openvino/.local/lib/python3.10/site-packages/openvino_tokenizers/lib/libopenvino_tokenizers.so: undefined symbol: _ZNK2ov4Node8evaluateERSt6vectorINS_6TensorESaIS2_EERKS4_RKSt3mapISsNS_3AnyESt4lessISsESaISt4pairIKSsS9_EEE

What needs to be done?

tell me if i miss any dependency installed or i need to compile from source?

Example Pull Requests

No response

Resources

Contact points

bsq1989

Ticket

No response

apaniukov commented 3 weeks ago

Hi @bsq1989,

This error is caused by the binary incompatibility of Ubuntu22 OpenVINO binaries and OpenVINO Tokenizers binaries built for PyPI distribution. One way to fix it is to rebuild the tokenizers inside the container. But it can be avoided, you can download many tokenizers binaries for various platforms from this storage, including Ubuntu22.

I pulled the latest openvino/ubuntu22_runtime container and replicated the error. These steps fixed it:

curl -O https://storage.openvinotoolkit.org/repositories/openvino_tokenizers/packages/2024.2.0.0/openvino_tokenizers_ubuntu22_2024.2.0.0_x86_64.tar.gz
tar -xf openvino_tokenizers_ubuntu22_2024.2.0.0_x86_64.tar.gz  -C /opt/intel/openvino_2024.2.0.15519/

Note, that if you installed the optimum-intel/openvino-tokenizers with pip3, you have two different openvino packages in the container: one from the container (here: /opt/intel/openvino_2024.2.0.15519/) and the other came from PyPI (here: /home/openvino/.local/lib/python3.10/site-packages/openvino). Putting compatible tokenizer binaries into the openvino folder forces openvino_tokenizers to use it, instead of the binaries from PyPI.

Let me know if you have other questions.