Skip to content
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

basic lib doesn't work with Ampere ARM processors #11

Closed
myNicole98 opened this issue May 25, 2023 · 6 comments
Closed

basic lib doesn't work with Ampere ARM processors #11

myNicole98 opened this issue May 25, 2023 · 6 comments

Comments

@myNicole98
Copy link

As the title suggest, if I try to set lib='basic' I get the following error:

/home/ubuntu/.local/lib/python3.10/site-packages/ctransformers/lib/basic/libctransformers.so: cannot open shared object file: No such file or directory

If I try to directly run libctransformers.so I get this error:

cannot execute binary file: Exec format error

@marella
Copy link
Owner

marella commented May 25, 2023

Hi, for ARM processors it has to be built from source as precompiled libs are not available #9 (comment):

git clone --recurse-submodules https://github.com/marella/ctransformers
cd ctransformers
./scripts/build.sh

The compiled binary will be located at build/lib/libctransformers.so which can be used as:

llm = AutoModelForCausalLM.from_pretrained(..., lib='/path/to/ctransformers/build/lib/libctransformers.so')

@myNicole98
Copy link
Author

It worked! Thanks for the help ^^

@NeonBohdan
Copy link

NeonBohdan commented Jul 5, 2023

Thanks it's working
Is it possible to provide aarch64 pypi package with prebuild libctransformers.so for convenience?

@marella
Copy link
Owner

marella commented Jul 6, 2023

I'm using GitHub Actions to build binaries but it doesn't support ARM processors currently.
I made it simpler to install from source now. You can just run the following command:

pip install ctransformers --no-binary ctransformers

@NeonBohdan
Copy link

@rvandernoort
Copy link

Hi, just stumbled on this thread trying to get ctransformers to work on an RPi4. Quick notes:

  • Firstly, a deprecation warning
pip install ctransformers --no-binary ctransformers
DEPRECATION: --no-binary currently disables reading from the cache of locally built wheels. In the future --no-binary will not influence the wheel cache. pip 23.1 will enforce this behaviour change. A possible replacement is to use the --no-cache-dir option. You can use the flag --use-feature=no-binary-enable-wheel-cache to test the upcoming behaviour. Discussion can be found at https://github.com/pypa/pip/issues/11453
  • Secondly, this installation method results in a unicode error for me:
print(llm(formatted_prompt))
UnicodeEncodeError: 'latin-1' codec can't encode character '\u2019' in position 49: ordinal not in range(256)
  • Lastly, manual installation from source work perfectly, however might it be a good idea to put this in the installation part of the readme, since I had to find it in a closed issue.

Overall love the library! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants