-
Notifications
You must be signed in to change notification settings - Fork 679
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
libtokenizers.so problems on alpine #2946
Comments
We only tested on ubuntu 18.04+ and centos7+. It looks like you are missing some glibc in your system. Can you try to install |
I tried this: bash-5.1# apk add glibc-bin-2.35-r1.apk
(1/3) Upgrading musl (1.2.3-r0 -> 1.2.3-r3)
(2/3) Installing libc6-compat (1.2.3-r3)
(3/3) Installing glibc-bin (2.35-r1)
Executing glibc-bin-2.35-r1.trigger
OK: 184 MiB in 105 packages And check the glibc version: bash-5.1# ldd --version
musl libc (x86_64)
Version 1.2.3
Dynamic Program Loader
Usage: /lib/ld-musl-x86_64.so.1 [options] [--] pathname So change the PATH: bash-5.1# export PATH="/usr/glibc-compat/bin/:$PATH"
bash-5.1# ldd --version
ldd (GNU libc) 2.35
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper. And still got this:
😭😭 |
Please take a look this: https://stackoverflow.com/questions/69607005/cannot-run-executables-with-alpine-and-busybox-docker-images Can you use ubuntu or centos based image? |
Finally I solve this by compiling the libtokenizers.so on the Alpine system. Prepare the compile environmentFirst we need to build an image:
PAY ATTENTION THAT WE NEED 3.13, or we get this problem while compiling. Second, we run this image container: sudo docker run -it -v /usr/local/djl_demo/:/opt/djl_demo/ --rm djl-jdk-alpine:1.0 /bin/bash And we need to install Rust following this:
Compile the libtokenizers.soBasically follow this. Download the DJL source code: git clone https://github.com/deepjavalibrary/djl/tree/v0.26.0 Go to the tokenizers source folder: cd ./djl-0.26.0/extensions/tokenizers Download the HuggingFace's tokenizer source code: git clone https://github.com/huggingface/tokenizers/tree/v0.15.0 Compile the libtokenizers.so: cargo build --manifest-path rust/Cargo.toml --release Mayby you will get this, just add variable before cargo build: export RUSTFLAGS="-C target-feature=-crt-static" Then you will get Cheat the cache dirmkdir -p /root/.djl.ai/tokenizers/0.15.0-0.26.0-linux-x86_64/
cp libtokenizers.so /root/.djl.ai/tokenizers/0.15.0-0.26.0-linux-x86_64/ Then the DJL uses the new libtokenizers.so. |
Description
(A clear and concise description of what the bug is.)
Hello, I want to use DJL on my project because the backend is written by JAVA.
I only use the
HuggingFaceTokenizer
, everythings going well on windows.But its not working when we deploying to alpine:
It seems the
libtokenizers.so
and the alpine image are incompatible, can we fix this?Environment Info
System: runtime-jre8u302-alpine
DJL version:
I checked the source code about loading libtokenizers.so:
LibUtils.java
Platform.java
And I checked the system info by:
Output:
So how to solve this? Do I need to compile the rust tokenizer on alpine?
Need help, thanks.
The text was updated successfully, but these errors were encountered: